ios:study-note
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ios:study-note [2012/09/07 20:34] – created percy | ios:study-note [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
====== iOS学习笔记 ====== | ====== iOS学习笔记 ====== | ||
+ | |||
+ | ===== NSUserDefaults ===== | ||
+ | < | ||
+ | NSString *setting=[[NSBundle mainBundle] pathForResource: | ||
+ | if (!setting) { | ||
+ | return; | ||
+ | } | ||
+ | | ||
+ | NSDictionary *dictionary=[NSDictionary dictionaryWithContentsOfFile: | ||
+ | NSArray *array = [dictionary objectForKey: | ||
+ | NSMutableDictionary *registerToDefault=[NSMutableDictionary dictionaryWithCapacity: | ||
+ | for (NSDictionary *item in array) { | ||
+ | | ||
+ | if (key) { | ||
+ | [registerToDefault setObject: | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | [[NSUserDefaults standardUserDefaults] registerDefaults: | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | NSString *title = [userDefault objectForKey: | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== NavigationController ===== | ||
+ | < | ||
+ | - (BOOL)application: | ||
+ | { | ||
+ | self.window = [[[UIWindow alloc] initWithFrame: | ||
+ | // Override point for customization after application launch. | ||
+ | self.window.backgroundColor = [UIColor whiteColor]; | ||
+ | navigationController=[[UINavigationController alloc] init]; | ||
+ | RootViewController *rootViewController=[[RootViewController alloc] initWithNibName: | ||
+ | rootViewController.title=@" | ||
+ | [navigationController pushViewController: | ||
+ | | ||
+ | [self.window addSubview: | ||
+ | | ||
+ | [self.window makeKeyAndVisible]; | ||
+ | |||
+ | [rootViewController release]; | ||
+ | | ||
+ | NSUserDefaults *userDefault=[NSUserDefaults standardUserDefaults]; | ||
+ | NSString *title = [userDefault objectForKey: | ||
+ | if(!title){ | ||
+ | [self performSelector: | ||
+ | } | ||
+ | | ||
+ | | ||
+ | return YES; | ||
+ | } | ||
+ | </ | ||
/var/www/dokuwiki/wiki/data/attic/ios/study-note.1347021293.txt.gz · Last modified: 2016/05/05 13:06 (external edit)