首页 > 代码库 > archivedDataWithRootObject NSUserDefaults

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] ;  

archivedDataWithRootObject NSUserDefaults