0
self.path = [self pathByCopyingFile:@"Notes List.plist"];
self.data = [[NSMutableDictionary alloc] initWithContentsOfFile:self.path];
self.notes = [self.data objectForKey:@"Notes"];
然后在一个按钮(按钮方法肯定会被调用):
NSString *title = self.navigationItem.title;
//Filter notes array by title
NSPredicate *pred = [NSPredicate predicateWithFormat:@"Title =[cd] %@", title];
NSArray * titleArray = [self.notes filteredArrayUsingPredicate:pred];
//delete all the notes with the old title name
[self.notes removeObject:titleArray];
NSLog(@"%@", self.notes);
在这一点上,self.notes仍包含项目我不知道他们为什么被剔除
因为NSArray不可变吗? http://stackoverflow.com/questions/7426570/remove-object-from-nsarray – Rob
我的“self.notes”是可变的 – user3001526