objective c - monitor changes on NSManagedObject similar to NSFetchedResultsController -


i implemented class similar nsfetchedresultscontroller - call dkdataarray. unlike nsfetchedresultscontroller doesn't fetch objects database gets them relation of object.

i want extend in way monitors changes in fetched objects , propagates changes delegate - nsfetchedresultscontroller does.

this delegate method i'd support:

@protocol dkdataarraydelegate  @optional - (void)dataarray:(dkdataarray *)dataarray   didchangeobject:(id)anobject           atindex:(nsinteger)index;  @end 

how can that?

thanks in advance!

you can register nsmanagedobjectcontextobjectsdidchangenotification of managed object context. documentation:

posted when values of properties of objects contained in managed object context changed. notification posted during processpendingchanges, after changes have been processed, ...
notification object managed object context. userinfo dictionary contains following keys: nsinsertedobjectskey, nsupdatedobjectskey, , nsdeletedobjectskey.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -