NSArry NSData 转换

it2022-05-09  20

NSArray *arr1 = [[NSArray alloc]initWithObjects:@"0",@"5",nil]; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:arr1]; NSArray *arr2 = [NSKeyedUnarchiver unarchiveObjectWithData:data]; NSLog(@"->%@",[arr1 objectAtIndex:1]); NSLog(@"->%@",[arr2 objectAtIndex:1]);

 

转载于:https://www.cnblogs.com/KingQiangzi/p/3555625.html


最新回复(0)