I have an attribute modificationDate
in my Entity A.
I want to set its value whenever NSManagedObject
is saved. However, if i try to do that in NSManagedObject
willSave:
method, i get an error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to process pending changes before save. The context is still dirty after 100 attempts. Typically this recursive dirtying is caused by a bad validation method, -willSave, or notification handler.' ***
So, i'm wondering, what's the best way to set the value of modificationDate
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…