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
- (NSString*)jsonStructureFromManagedObjects:(NSArray*)managedObjects; | |
- (NSArray*)managedObjectsFromJSONStructure:(NSString*)json withManagedObjectContext:(NSManagedObjectContext*)moc; | |
- (NSDictionary*)dataStructureFromManagedObject:(NSManagedObject*)managedObject | |
{ | |
NSDictionary *attributesByName = [[managedObject entity] attributesByName]; | |
NSDictionary *relationshipsByName = [[managedObject entity] relationshipsByName]; | |
NSMutableDictionary *valuesDictionary = [[managedObject dictionaryWithValuesForKeys:[attributesByName allKeys]] mutableCopy]; | |
[valuesDictionary setObject:[[managedObject entity] name] forKey:@"ManagedObjectName"]; | |
for (NSString *relationshipName in [relationshipsByName allKeys]) { |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
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
- (NSArray*)listOfNames { | |
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
[request setEntity:[NSEntityDescription entityForName:@"SomeObject" inManagedObjectContext:self.managedObjectContext]]; | |
[request setResultType:NSDictionaryResultType]; | |
[request setPropertiesToFetch:[NSArray arrayWithObject:@"name"]]; | |
[request setPropertiesToGroupBy:[NSArray arrayWithObject:@"name"]]; | |
[request setPredicate:[NSPredicate predicateWithFormat:@"type = %@", @"static"]]; |
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
// | |
// ARC Helper | |
// | |
// Version 2.2 | |
// | |
// Created by Nick Lockwood on 05/01/2012. | |
// Copyright 2012 Charcoal Design | |
// | |
// Distributed under the permissive zlib license | |
// Get the latest version from here: |
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
NSArray *names = [UIFont familyNames]; | |
for (NSString *fontName in names) { | |
NSLog(@"%@:", fontName); | |
NSArray *fontnames = [UIFont fontNamesForFamilyName:fontName]; | |
for (NSString *fontNameinFamily in fontnames) { | |
NSLog(@"-->%@", fontNameinFamily); | |
} | |
} | |
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
@protocol SomeClassDelegate <NSObject> | |
- (void) SomeClassSelector:(ParamType*)param; | |
@end | |
@interface SomeClass : UIViewController { | |
id <SomeClassDelegate> delegate; | |
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
// DataManager.h | |
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
extern NSString * const DataManagerDidSaveNotification; | |
extern NSString * const DataManagerDidSaveFailedNotification; | |
@interface DataManager : NSObject { | |
} |
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
- (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef angle:(CGFloat)angle | |
{ | |
CGFloat angleInRadians = angle * (M_PI / 180); | |
CGFloat width = CGImageGetWidth(imgRef); | |
CGFloat height = CGImageGetHeight(imgRef); | |
CGRect imgRect = CGRectMake(0, 0, width, height); | |
CGAffineTransform transform = CGAffineTransformMakeRotation(angleInRadians); | |
CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, transform); |
NewerOlder