Tag: nsmanagedobject

更改托pipe对象属性不会触发NSFetchedResultsController更新表视图

我有一个带谓词的fetchedResultsController ,其中“isOpen == YES” 当调用closeCurrentClockSet时 ,我将该属性设置为NO 。 因此,它不应该再出现在我的tableView。 由于某种原因,这没有发生。 有人可以帮我解决这个问题吗? -(void)closeCurrentClockSet { NSPredicate * predicate = [NSPredicate predicateWithFormat:@"isOpen == YES"]; NSArray *fetchedObjects = [self fetchRequestForEntity:@"ClockSet" withPredicate:predicate inManagedObjectContext:[myAppDelegate managedObjectContext]]; ClockSet *currentClockSet = (ClockSet *)fetchedObjects.lastObject; [currentClockSet setIsOpen:[NSNumber numberWithBool:NO]]; } – 我有更多的方法,使用完全相同的方法 ,通过调用自定义的fetchRequestForEntity:withPredicate:inManagedObjectContext方法。 在这些方法中,当更改属性时,tableView会正确更新! 但是上面这一个( closeCurrentClockSet ),不! 我无法弄清楚为什么。 – 我的fetchedResultsController的实现来自Apple的文档。 另外,另一个细节。 如果我发送我的应用程序,背景。 closures它,重新打开,tableView显示更新,因为它应该! 我已经尽力在stackoverflow上遵循先前的问题。 没有运气。 我也NSLogged这个骨头。 该对象正在被正确提取。 这是正确的。 […]