views:

55

answers:

1

I have a question concerning Core Data and how, if at all, Entities get updated automatically.

Basically, let's say I fetch some data X. X has an inverse to-many relationship with Y. Then a method get's called to update an attribute in X. Does one have to fetch the data again? or will X automatically get the updated data?

If this is not possible, that's fine. I was just curious as I saw a post a few days ago. I don't remember the details, but I think it spoke about how to have the NSManagedObjects automatically update/refresh their data and was curious if this is something true, or a setting you must set, or just not possible.

I'm actually in the process of refetching the data to update the table. This is fine with me, but again, I am just curious if what I read is true or if I misunderstood the post.

Thanks.

+1  A: 

If your data model state changes, an update needs to take place somewhere, in order for changes to be reflected in the UI. If you use NSFetchedResultsController, updates to the UI can be managed more easily. Here is some documentation.

Alex Reynolds
So if I do not use NSFetchResultsController, which I don't, would I have to make my own methods to **refresh** the data? (That's what I'm doing now)
RoLYroLLs
Yes, that's correct.
Alex Reynolds
Sorry or the lateness. Up-voted and accepted. Thanks.
RoLYroLLs