Created
April 26, 2011 07:02
-
-
Save joericioppo/941919 to your computer and use it in GitHub Desktop.
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
@implementation NSArray (NSArray+MyAdditions) | |
- (NSArray *)arrayOfClass:(Class)class { | |
// oh look, dictionaries.. | |
} | |
@implementation NSObject (NSObject+MyAdditions) | |
- (id)initWithDictionary:(NSDictionary *)dictionary { | |
self = [super init]; | |
if (self == nil) { | |
return nil; | |
} | |
[self setValuesForKeysWithDictionary:dictionary]; | |
return self; | |
} | |
@end | |
@implementation MyModelObject | |
- (void)setValuesForKeysWithDictionary:(NSDictionary *)keyedValues { | |
self.propertyName = [keyedValues valueForKey:@"underscore_bullshit"]; | |
// etc.. | |
} | |
// thanks @bmf! | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment