开发者

NSObjectInaccessibleException - CoreData could not fulfill a fault

开发者 https://www.devze.com 2023-01-04 04:38 出处:网络
My iPhone application crashes when and I do not know how to resolve it. I have a secondary thread that does some cleanup (deletes objects). This cleanup is done on asecond NSManagedObjectContext as

My iPhone application crashes when and I do not know how to resolve it.

I have a secondary thread that does some cleanup (deletes objects). This cleanup is done on a second NSManagedObjectContext as apple recommend when doing stuff in another thread. When the cleanup is finished I merge the two contexts.

My problem is that my application crashes when the tableview somehow tries to show a deleted object while the cleanup is running in the backgr开发者_高级运维ound.

Does anyone have a example or something that could show me a safe way to delete chunks of data in another thread without getting this problem?


This was solved by removing [fetchRequest setFetchBatchSize:20]; and disable caching!

0

精彩评论

暂无评论...
验证码 换一张
取 消