The documentation states:
Changes are not reflected until after the controller’s managed object context has received a processPendingChanges() message. Therefore, if you change the value of a managed object’s attribute so that its location in a fetched results controller’s results set would change, its index as reported by the controller would typically not change until the end of the current event cycle (when processPendingChanges() is invoked).
Maybe what’s happening is just that. And on the view context pending changes are just processed sooner. You could hook into that method to check.
https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller
Post
Replies
Boosts
Views
Activity
Setting relationships in batch requests is not supported. Check out the WWDC talks from 2019 and 2020.
Look into NSPredicate syntax.
Million dollar question, what’s certain is that batch requests don’t support relationships.
This is impossible to answer without seeing your app. How you interact with the data source and use it to configure the layout of the the collection view and its cells has a large impact on performance.
You might consider disabling the validation rule and using a batch insert followed by a batch delete of objects that would have broken the rule.
Hmm the code is just auto generated boilerplate, maybe include something more substantive and you will get better advice.
If this is really when you want to save(), I suggest reading up on the lifecycle of an app and using appropriate scene delegate methods if that’s the flow your app used.
Of course, iOS doesn’t ever really tell you if your app has been force-terminated by the user.
I wish I could edit the title! 😅
For indexing purposes, the correct word is:
NSManagedObjectContext
Same crash here. iOS 16.6