0

I am using a UISplitViewController to manage the Master and Detail view. Everything is working fine going from master to detail. I can select an item from the list and through the delegate it updates the detail view.

I want to be able to delete an item using a button on the detail view. This is very simple to do on the detail view. However, I cannot seem to figure out how to change the master view to reflect the fact that an item has been deleted.

Here is my example: SampleCode

Alexander
  • 86
  • 1
  • 3
  • 17

1 Answers1

3

Make the master a delegate of the detail view. That is: when you fire up the detail from the master, tell the detail who the master is, preferably by using a delegate construction.That way the detail can inform the master when any changes should occur.

Or you can also put the data in CoreData, and have the master notified automatically when a changes occurs in the CoreData tables. Check NSManagedObjectContextObjectsDidChangeNotification for more info.

Jelle
  • 1,024
  • 10
  • 18
  • how can I use the delegate construction, do you have an example? – Alexander May 05 '12 at 18:09
  • 1
    sure, this is quite a nice example: http://www.roostersoftstudios.com/2011/04/12/simple-delegate-tutorial-for-ios-development/ – Jelle May 05 '12 at 20:17
  • as you can see in my example I use exactly the same delegate structure, unfortunately it doesn't work, the entries will be not deleted from the array. That is the reason why I asked the question. – Alexander May 05 '12 at 20:43