I have an attribute synced of type Integer16 in my core-data model. I am trying to set the value of synced to [NSNumber numberWithBool:YES], when the value is synced with that on my server, just like I do on many of the other managed object subclasses I have in my app. The problem is, that for this particular class, any time I call [context save:], the value gets reset to [NSNumber numberWithBool:NO].
My suspicion was that I might have another instance of that object in my code somewhere that has synced set to NO, but I’m fairly certain that this is not the case. Can anyone offer me some advice to help resolve this issue?
Thanks!
Kind of hard without any real code but things you could try:
Override the setter and place a break point so you can see when it is being called.
OR try using KVO for the same purpose (see when the values being changed)
Make sure you have not overridden
willSavewith anything that is changing the value.Check it is definitely the same object that was saved/fetched?