您的位置:首页 > Web前端 > JavaScript

数据处理

2015-09-24 10:22 639 查看
JSON解析

NSString *path = [[NSBundle mainBundle] pathForResource:@"activitylist" ofType:@"txt"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSMutableDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];


使用本地文件

1.找到文件的路径
NSString *path = [[NSBundle mainBundle]pathForResource:@"0825Student" ofType:@"plist"];
self.stuArr = [NSMutableArray array];

2.读取本地数据
self.stuArr = [NSMutableArray arrayWithContentsOfFile:path];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息