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

你可能感兴趣的:(NSUserDefaults)