Created
February 12, 2014 01:19
-
-
Save alex-zige/8948097 to your computer and use it in GitHub Desktop.
iOS read local JSON for object parsing
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
NSString *jsonFileName =@"your-json-file-name"; | |
NSString *filePath = [[NSBundle mainBundle] pathForResource:jsonFileName ofType:@"json"]; | |
NSData *JSONData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:nil]; | |
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingMutableContainers error:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment