Let's assume I have an address book App. So from the address list I now push to a detail view like so:
- User taps on cell in the master list
- Segue
showDetail
is invoked - In
prepareForSegue:
I set the model objectcontact
of myContactDetailViewController
viewWillAppear
I add an observer forself.contact
- So now when the
contact
object changes in the background, the detail view will automatically be updated. - In
viewWillDisappear
I remove this observer (I guess it's clean because it is symetrical).
However, viewWillAppear:
is called after I set the contact. So should I setup the KVO differently or simply call my updateView
function in viewWillAppear
which is a bit stupid because I want to get rid of those calls with KVO in the first place.