1

さて、NSMutableArray に格納した NSNumber オブジェクトの配列を作成しました。ゲームが読み込まれると、アーカイブが解除されて保持されますが、すべての NSNumber オブジェクトが失われます。これが私のコードです:

times = [[NSMutableArray alloc] initWithObjects:[[NSNumber alloc] initWithFloat:time],nil];
[NSKeyedArchiver archiveRootObject:times toFile:@"times"];
...

NSMutableArray *newTimes = [[NSKeyedUnarchiver unarchiveObjectWithFile:@"times"] retain];
times = [[NSMutableArray alloc] initWithArray:newTimes];
[newTimes release];

助けてください。

4

0 に答える 0