像在 NSDefaults 中一样将数组存储为 NSData
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:urArray1] forKey:@"Array1"];
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:urArray2] forKey:@"Array2"];
并将其读作
NSData *dataRepresentingSavedArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"Array1"];
if (dataRepresentingSavedArray != nil)
NSArray *oldSavedArray = [NSKeyedUnarchiver unarchiveObjectWithData:dataRepresentingSavedArray];