AppDelegate.h
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
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][@"title"]);
NSLog(@"%@", dic[@"events"][2][@"begin_time"]);
NSLog(@"%@", dic[@"events"][2][@"end_time"]);
NSArray *arr = dic[@"events"];
for (NSDictionary *dic in arr) {
NSLog(@"%@", dic[@"loc_name"]);
}
for (NSDictionary *dic in arr) {
NSLog(@"%@", dic[@"owner"][@"name"]);
}
return YES;
}