UI---JSON数据解析
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 }
有人说:爱上一座城,是因为城里住着某个人,能够与所爱的人在一起,连光阴都是美的。即便粗茶淡饭,修篱种田,只要有你陪伴就好。那么,找一个青山绿水的地方,寻一处幽静的茅舍,或是云水禅心的庭院,那里有晴朗的阳光和静谧的悠然,还有你明媚的笑脸。掬一捧花香在平淡的日子,握着一路相随的暖意,让爱的馨香在柴米油盐中升腾;在一杯茶的温情里,体味生活的诗意;在一碗粥的清淡中,感受生活的浪漫,每天清晨你和阳光都在,便是我的幸福。——春暖花开 《择一城终老,遇一人白首》