3
votes

Ok, so I've asked a similar question already, but I'm now faced with a different issue on the same problem! I'm creating an iPad application and trying to replicate the Apple Mail App UI. Initially I could not update the DetailView because I was not updating the delegate when pushing a new navigation controller on the left view, this was resolved using:

newRootViewController.myDelegate = self.delegate;

I've included functionality from Apple's MultipleDetailViews code sample to include more than one detail view (using < SubstitutableDetailViewController >), but this stops the label from updating on the detail view.

I can resolve this issue by removing the connection between splitViewController and RootViewController using IB and then the label update works, although this [obviously] stops the multiple Detail view functionality from working.... any ideas?

1

1 Answers

3
votes

I haven't seen the MutipleDetailViews example but my guess is that its your delegate.

When you select a cell in the root it delegates to the detail. In your previous Question You where changing the root by pushing a new one onto the nav; this required you to set the delegate of the new root to the same delegate of the previous.

Your root view is pointing to your original detail.

If you replace or change the detail then any delegation sent from the root is either going to nil (if you destroyed the old detail) or you cant see it (if its just sitting behind the new detail)

If you are replacing the detail (destroyed the old one) you need to set the delegate of the root again (all/any roots).

If you are changing/adding new views then you should really be looking at NSNotificationCenter

Example:

[NSNotificationCenter defaultCenter]
  addObserver:self
     selector:@selector(handleSomethingDidHappen:)
         name:ClassCSomethingDidHappenNotification                
       object:aClassCObject];