AppDelegate.m
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)dealloc
{
[_window release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
[_window release];
// 寻找数据路径.
NSString *path = [[NSBundle mainBundle] pathForResource:@"activitylist" ofType:@"txt"];
// 将文件转化成文件.
NSData *data = [NSData dataWithContentsOfFile:path];
// 解析数据.
NSMutableDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
// 寻找要找的数据
NSLog(@"%@", dic[@"events"][2][@"begin_time"]);
return YES;
}
UI_数据处理(txt)
最新推荐文章于 2022-02-25 15:45:23 发布