views:

29

answers:

1

I am using Core Data for an iPhone application. I have a property isChangedFromOriginal that defines if the data (for several fields - if one is changed it is the same as if all were changed) was changed from a preloaded standard.

I am planning to create a subclass of NSManagedObject and perform the checks in ValidateForUpdate:, however, this would entail setting a property in this method. I can't find any documentation if this is a good or bad idea, any input?

thanks

+2  A: 

It is a bad idea. It is intended only to be used for validation and not for data manipulation because you can inadvertently fire off another validation check and send yourself into an endless loop.

Marcus S. Zarra