Created
February 15, 2012 17:51
-
-
Save pashields/1837707 to your computer and use it in GitHub Desktop.
An example of loading ClassMapper keymappings from a plist file
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
#import "MapperConfig.h" | |
@interface MapperConfig (PListReader) | |
- (void)importFromPList:(NSString*)pListName; | |
@end | |
@implementation MapperConfig (PListReader) | |
- (void)importFromPList:(NSString*)pListName { | |
NSString *path = [[NSBundle mainBundle] pathForResource:pListName ofType:@"plist"]; | |
NSDictionary *mappings = [[NSDictionary alloc] initWithContentsOfFile:path]; | |
for (NSString *key in mappings) { | |
[[MapperConfig sharedInstance] mapPropertyName:key toOtherName:[mappings objectForKey:key]]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment