last day (14 days later) » 

10:07 AM
0
A: Crash while replacing NSFetchedResultsController for UICollectionView during CoreData updates

WainWhile your batching code looks clever and efficient it's very difficult to ensure that the batch of changes are cogent. If any sections are inserted or deleted, or any items are moved then it's very, and i mean very, difficult to ensure that all other index paths are correct and refer to the appr...

 
Oh, I guess I misunderstood your "code for your change processing" For FRC change I tried several things. At the moment before any FRC-Change happens I remove the delegate and set the current FRC to nil and even reload the CollectionView. Then simply create a new FRC
 
you have code for change processing saving into core data and in the FRC delegate methods, i asked for both, it's all good. by FRC change i mean switching between different FRC instances, and your description sounds ok
 
My problem is that even reloadData instead of batchUpdate will lead to a crash
 
how and when do you reload in this case, and what's the crash?
 
I tried reload on controllerDidChange and the weird thing is, the crash is the same
 
10:07 AM
and you removed / commented all of the other code?
 
Sure commented all the code above
 
so how do you change the FRC then, in detail - does it overlap with a notification from your current FRC ?
 
The overlap is my concern …
What I do is, before I create the new FRC I check if there is an existing one. If so, I do the following:
- Set the delegate of the existing FRC to nil
- set the existing FRC to nil

and then create the new one
(damn "enter"-handling on the chattext field)
I thing what would be needed (but not available) is to interrupt the CollectionView from performing the batchUpdate-Block
 
10:29 AM
ok, but do you know you're changing the FRC before the current FRC gets the context save notification...
or at least before it tells the collection view about any changes
 
That's my dilemma I believe. It think sometimes the current FRC tells the CollectionView to update and during that update the FRC is replaced
 
so how and when do you know about the FRC change ?
 
10:54 AM
The UI contains an segmented control … if the user changes the selection the FRC will change
 
are your crashes actually related to tapping that, or just to the updates from model changes ?
 
i believe updates …
 
11:19 AM
reloading should avoid that, because there should be no individual insertion / modification / deletion and that's what causes the errors
i can't say much more other than you need to work out where those partial changes are coming from when you reload
 

last day (14 days later) »