Skip to content

Instantly share code, notes, and snippets.

View tolentinokas's full-sized avatar
💭
I may be slow to respond.

Karen tolentinokas

💭
I may be slow to respond.
View GitHub Profile
@kyleclegg
kyleclegg / RestKit Local Loading
Last active January 28, 2018 23:38
RestKit - Load data from local json file
NSString *filePath = [[NSBundle mainBundle] pathForResource:JohnSmith ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:filePath];
if (data) {
NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
KCUser *appUser = [[KCUser alloc] init];
NSString* MIMEType = @"application/json";
NSError* error;
NSData *data = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
id parsedData = [RKMIMETypeSerialization objectFromData:data MIMEType:MIMEType error:&error];