#import "ViewController.h"
@interface ViewController ()
{
NSDictionary *dic;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *path = [[NSBundle mainBundle]pathForResource:@"Data" ofType:@"json"];
NSData *dataJson = [NSData dataWithContentsOfFile:path];
dic = [NSJSONSerialization JSONObjectWithData:dataJson options:NSJSONReadingMutableContainers error:nil];;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
NSLog(@"dataJson =%@",dic);
}
@end
网友评论