Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSFetchedResultsChangeUpdate not counted #19

Closed
wants to merge 2 commits into from

Conversation

mikhailmulyar
Copy link

When using TLIndexPathController with NSFetchRequest, TLIndexPathUpdates internally not looking for NSFetchedResultsChangeUpdate and therefore simple item updates do not update corresponding cells.

@DAOCUONG
Copy link

I have experienced this issued too when i modified core data object and
save, it doesnt TLIndexPathUpdates calculates old and new model but its the
same and as a results it do nothing.
Trick i used for now is delete the old one and add new one but it should be
fixed cause inefficient operation

On Thu, Mar 13, 2014 at 6:53 AM, mmj notifications@github.com wrote:

When using TLIndexPathController with NSFetchRequest, TLIndexPathUpdates
internally not looking for NSFetchedResultsChangeUpdate and therefore
simple item updates do not update corresponding cells.

Reply to this email directly or view it on GitHubhttps://github.com//issues/19
.

@wtmoose
Copy link
Member

wtmoose commented Mar 13, 2014

TLIndexPathTools works by comparing two data models. Therefore, it can't detect modifications if the same instance exists in both data models. I am considering new APIs that would solve this, but what I want to do is too big to build unless my job needs it.

I will try to think of a simple workaround. Suggestions welcome.

@mikhailmulyar
Copy link
Author

I currently tested simple workaround. I stored all items which updated in NSFetchedResultsChangeUpdate in array . Right after creating TLIndexPathUpdates i am adding those items to modifiedItems if they are not presented there already. Since modifiedItems is readonly i created new method for that. Actually doesn't look like very beautiful solution, but it works.

@wtmoose
Copy link
Member

wtmoose commented Mar 13, 2014

Excellent. I was thinking of something similar. Can you submit a pull request if you get it working?

Thanks!

Tim

On Mar 13, 2014, at 9:50 AM, mmj notifications@github.com wrote:

I currently tested simple workaround. I stored all items which updated in NSFetchedResultsChangeUpdate in array . Right after creating TLIndexPathUpdates i am adding those items to modifiedItems if they are not presented there already. Since modifiedItems is readonly i created new method for that. Actually doesn't look like very beautiful solution, but it works.


Reply to this email directly or view it on GitHub.

@mikhailmulyar mikhailmulyar deleted the #19_fix branch May 13, 2014 08:42
mikhailmulyar pushed a commit to mikhailmulyar/TLIndexPathTools that referenced this pull request May 13, 2014
wtmoose pushed a commit that referenced this pull request May 28, 2014
When using TLIndexPathController with Core Data, updated managed objects were not being detected because the old and updated data models provided to TLIndexPathUpdates contained the same instance. With this fix, TLIndexPathController listens to the updated item notifications coming from the internal NSFetchedResultsController and passes the list of updated items to TLIndexPathUpdates.
@wtmoose
Copy link
Member

wtmoose commented May 28, 2014

I finally promoted a fix for this issue. Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants