Skip to content

Instantly share code, notes, and snippets.

@quellish
Created September 21, 2014 08:45
Show Gist options
  • Select an option

  • Save quellish/b9748cf4305e6fdcbe4a to your computer and use it in GitHub Desktop.

Select an option

Save quellish/b9748cf4305e6fdcbe4a to your computer and use it in GitHub Desktop.
JSONPersonDataSource
NSString * const JSONPersonFirstNameKeyPath = @"firstName";
NSString * const JSONPersonLastNameKeyPath = @"lastName";
@implementation JSONPersonDataSource
- (instancetype) initWithJSON:(id)json {
if ((self = [super init])){
jsonObject = json;
}
return self;
}
- (NSString *)firstName {
[[self jsonObject] valueForKeyPath:JSONPersonFirstNameKeyPath];
}
- (NSString *)lastName {
return [[self jsonObject] valueForKeyPath:JSONPersonLastNameKeyPath];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment