Created
July 20, 2012 14:27
-
-
Save rondy/3151012 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
- (void) getDataFromLocalJSON | |
{ | |
NSString *jsonPath = @"response.json"; | |
NSFileHandle *file; | |
NSData *databuffer; | |
file = [NSFileHandle fileHandleForReadingAtPath: jsonPath]; | |
if (file) { | |
databuffer = [file readDataToEndOfFile]; | |
[file closeFile]; | |
} | |
else { | |
NSLog(@"Failed to open file"); | |
} | |
NSError *error; | |
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:databuffer options:kNilOptions error:&error]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment