标签:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadView:)
name:@"reloadViewNotification"
object:nil];
NotesNextiveJsonParser *parser = [NotesNextiveJsonParser new];
//开始解析
[parser start];
NSString* path = [[NSBundle mainBundle] pathForResource:@"Notes" ofType:@"json"];
NSData *jsonData = [[NSData alloc] initWithContentsOfFile:path];
NSError *error;
id jsonObj = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers error:&error];
if (!jsonObj || error) {
NSLog(@"JSON解码失败");
}
self.listData = [jsonObj objectForKey:@"Record"];
}
标签:
原文地址:http://www.cnblogs.com/zhongxuan/p/4858119.html