0.新创建一个json文件,把json串拷贝到里面
1.先通过MainBundle找到资源对应的路径
2.将文件转换为NSData
3.通过NSJSonSerization得到字典
NSString*fileName=[[NSBundle mainBundle] pathForResource:@"myJson" ofType:@"json"];
NSData *jsonData = [NSData dataWithContentsOfFile:fileName options:NSDataReadingMappedIfSafe error:nil];
NSMutableDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:nil];
NSData *jsonData = [NSData dataWithContentsOfFile:fileName options:NSDataReadingMappedIfSafe error:nil];
NSMutableDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:nil];