This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pragma mark - | |
# pragma mark - Scale and Rotate according to Orientation | |
- (UIImage *)scaleAndRotateImage:(UIImage *)image | |
{ | |
int kMaxResolution = 450; // Or whatever | |
CGImageRef imgRef = image.CGImage; | |
CGFloat width = CGImageGetWidth(imgRef); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark - Creating Object | |
-(id)createObjectForEntity:(NSString *)entityName | |
{ | |
if (entityName!=nil || [entityName isEqualToString:@""]) | |
{ | |
return [NSEntityDescription | |
insertNewObjectForEntityForName:entityName | |
inManagedObjectContext:appDelegate.managedObjectContext]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(MKCoordinateRegion) regionForAnnotations:(NSMutableArray *)annotations | |
{ | |
double minLat=90.0f, maxLat=-90.0f; | |
double minLon=180.0f, maxLon=-180.0f; | |
for (id<MKAnnotation> mka in annotations) { | |
if ( mka.coordinate.latitude < minLat ) minLat = mka.coordinate.latitude; | |
if ( mka.coordinate.latitude > maxLat ) maxLat = mka.coordinate.latitude; | |
if ( mka.coordinate.longitude < minLon ) minLon = mka.coordinate.longitude; | |
if ( mka.coordinate.longitude > maxLon ) maxLon = mka.coordinate.longitude; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |