我工作的NSKeyArchive並運行到這個問題...什麼我有迄今unarchiveObjectWithFile返回的NSArray
1.-(BOOL)archiveItem
2.{
3. NSString *path = [self findPath];
4. if ([NSKeyedArchiver archiveRootObject:items toFile:wishListPath])
5. {
6. return YES;
7. }else{
8. return NO;
9. }
10.}
11.-(BOOL)unarchiveItem
12.{
13. NSString *path = [self findPath];
14. self.items = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
15. NSLog(@"Class of items is %@",[self.items class]);
16. if (self.items == nil)
17. return NO;
18. else
19. return YES;
20.}
在我的頭文件中,項目被宣佈像
@property (nonatomic, copy) NSMutableArray *items;
然而第15行示出了該類型的物品是的NSArray (未NSMutablArray)
有沒有人有關於這個的想法,請幫忙。所有意見都歡迎。 感謝
它沒有再工作..我得到這個* - [__ NSArrayI removeObjectAtIndex:]:無法識別的選擇發送到實例0x6f26af0 * – tranvutuan 2012-02-07 03:11:06
看到我的編輯,希望這將現在的工作 – 2012-02-07 03:16:41
是的,當我改變保留。它就像一個魅力...感謝 – tranvutuan 2012-02-07 03:27:37