archivedDataWithRootObject NSUserDefaults

archivedDataWithRootObject  存储

BusinessCard *bc = [[BusinessCard alloc] init];  
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];  
NSData *udObject = [NSKeyedArchiver archivedDataWithRootObject:bc];  
[ud setObject:udObject forKey:@"myBusinessCard"];  
 
udObject = nil;  
udObject = [ud objectForKey:@"myBusinessCard"];  
bc = [NSKeyedUnarchiver unarchiveObjectWithData:udObject] ;  
上一篇:洛谷八连测R6


下一篇:DWZ (JUI) 教程 根据ID刷新 dialog