读取json文件

读取json文件

NSString *path = [[NSBundle mainBundle] pathForResource:@"area" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSError *error;
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];

你可能感兴趣的:(读取json文件)