views:

54

answers:

1

I created a separate NSManagedObjectContext on a separate thread to perform some store maintenance. However, I have noticed that the context returns YES for hasChanges as soon as a managed object in it is even referenced e.g.

NSString *name = managedObject.name;

This context is created and used exclusively in 1 method. Why is it returning has changes, when there there are none?

+2  A: 

That ks difficult to answer without seeing the code. Perhaps your object has a -awakeFromFetch call that touches a property or something else. Normally there should be no changes from just fetching an object unless you are doing something to that object either in the awakeFromFetch or somewhere else in your code.

update

Before the save, grab the deleted array, updated array and inserted array and take a peek at them. That will give you a hint as to what is going on.

Marcus S. Zarra
Thanks for your reply. I don't have an awakeFromFetch call or any other method invoking changes on the context in question. It's really strange!
Run Loop