views:

363

answers:

1

In a tab bar application, I'm adding a view to my first tabbar view by doing:

[self.view addSubview:anotherView.view];

Once anotherView is done, I do:

    [self.view removeFromSuperview];

Which goes back to the parent but doesn't fire viewDidAppear or viewWillAppear on the parent. I can use messaging but it seems there must be a better way. Any suggestions?

+1  A: 

When you add a subview to the first view, it's still visible, just behind the second view. Those methods don't fire because technically it's visible the whole time, even if it's completely covered by the second view.

Jeff Kelley
I see. Would I then need to use messaging? Thanks.
4thSpace
Either use messaging or change how you're doing this. For instance, you could set up a UINavigationController with the first view as its root view, hide its navigation bar, and push the second view controller onto it.
Jeff Kelley