码迷,mamicode.com
首页 > Web开发 > 详细

UI---JSON数据解析

时间:2016-06-06 16:28:15      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:

 1 #import "AppDelegate.h"  
 2   
 3 @implementation AppDelegate  
 4   
 5 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions  
 6 {  
 7     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];  
 8     // Override point for customization after application launch.  
 9     self.window.backgroundColor = [UIColor whiteColor];  
10     [self.window makeKeyAndVisible];  
11       
12       
13     // 1.获得文件路径  
14     NSString *path = [[NSBundle mainBundle] pathForResource:@"studentJSON" ofType:@"txt"];  
15       
16     NSData *data = [NSData dataWithContentsOfFile:path];  
17       
18     // 2.json解析  
19     id object = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];  
20    // NSLog(@"%@", [object class]);  
21     NSLog(@"%@", object);  
22       
23       
24     [_window release];  
25     return YES;  
26 }  
27 -(void)dealloc  
28 {  
29     [_window release];  
30     [super dealloc];  
31 }  

 

UI---JSON数据解析

标签:

原文地址:http://www.cnblogs.com/-Eric-Liu/p/5563987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!