-1
這是我的代碼:奇怪的錯誤而unarchiveObjectWithFile
array = [[NSMutableArray alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the
//documents directory:
NSString *fullFileName = [NSString stringWithFormat:@"%@/file", documentsDirectory];
array = [NSKeyedUnarchiver unarchiveObjectWithFile:fullFileName];
是什麼在我的代碼錯誤?
這是錯誤
[__NSArrayM count]: message sent to deallocated instance 0xd5864e0
感謝您的回答,我不使用ARC ...我做了@property(nonatomic,retain)NSMutableArray * array; – 2012-07-29 10:51:47
另一個問題,我不想要一個autorelease對象...我該如何強制unarchiveObjectWithFile返回一個NOT-autorelease對象? – 2012-07-29 10:54:48
請參閱我的編輯... – sergio 2012-07-29 10:58:51