I'm using a custom UITableViewCell
to display properties of a NSMangedObject
from my model.
Each cell holds a reference to the managed object.
I also listen to changes in properties of the object by calling addObserver:…
on the object.
The problem is that the objects can be removed from the model, and I want to unregister when this happens.
There is a similar question here, but the suggested solution there is to use prepareForDeletion
on the object, and then manually notify the cells. This is not a very pretty solution.
I was wondering what is the recommended solution for these cases, and more then that - is observing KVO changes on the managed object is indeed the best approach to what I am trying to achieve.