2012-05-14 38 views

回答

13

簡單,quick'n'dirty例如:

NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"foobar" 
                ofType:@"json"]; 
NSData *data = [NSData dataWithContentsOfFile:jsonPath]; 
NSError *error = nil; 
id json = [NSJSONSerialization JSONObjectWithData:data 
              options:kNilOptions 
              error:&error]; 
NSLog(@"JSON: %@", json);