NSNumbers in archived array dissappear
Okay I've made an array of NSNumber objects that I've stored into an NSMutableArray. When the game loads it's unarchived and retained but all the NSNumber objects are gone. Here's my code:
times = [[NSMutableArray alloc] initWithObjects:[[NSNumber alloc] initWithFloat:time],nil];
[NSKeyedArchiver archiveRootObject:times toFile:@"times"];
...
NSMutableArray *newTimes = [[NSKeyedUnarchiver unarchiveObjectWithFile:@"times"] retain];
times = [[NSMutableArray alloc] ini开发者_如何学PythontWithArray:newTimes];
[newTimes release];
Please help.
精彩评论