objective c - Core Data before Update callback -
i have entities have createdat
, updatedat
properties. trying set value of attributes automatically upon insert/update.
after doing research, found out there awakefrominsert
method use set value of createdat
property automatically when new object created.
however, not find similar updating object. should do? have update updatedat
property manually every time?
it depends want achieve. updating on save at:
-(void)willsave;
remember modifying properties @ place call willsave
again. so, have update updatedat
once. also, have check object wasn’t deleted - isdeleted
.
you may observe properties , set updatedat
date when updated, not saved.
Comments
Post a Comment