NSExpression based Core Data fetch does not retrieve current values (iOS 5, GCD)

邮差的信 提交于 2019-12-05 09:59:10

Unfortunately, this is not possible. See the documentation of setIncludesPendingChanges::

Special Considerations

A value of YES is not supported in conjunction with the result type NSDictionaryResultType, including calculation of aggregate results (such as max and min). For dictionaries, the array returned from the fetch reflects the current state in the persistent store, and does not take into account any pending changes, insertions, or deletions in the context.

Include pending changes: Insert [request setIncludePendingChanges:YES]; before you do the fetch.

This ensures that unsaved changes are included in the fetch.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!