#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
JSON
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯系作者
- 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
- 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
推薦閱讀更多精彩內容
- json.dumps是將一個Python數據類型列表進行json格式的編碼解析,示例如下: 這樣我們就將一個lis...
- ** 本文章著作權歸沒夢想的咸魚丶所有,轉載須說明來源** 1.首先明確JSON是什么? json是一種數據交換格...
- 1、JSONString轉換為字典 2、字典轉換為JSONString
- 最近在學習Vue.js,里面有個存儲、讀取本地緩存的功能,不停地用JSON.parse(),和JSON.strin...
- pom.xml 內容: <dependency><groupId>net.sf.json-lib</groupId...