views:

49

answers:

0

I have 3 views in my app. Main view has 2 buttons and when selected it displays 2nd view(which again has buttons and displays a 3rd view with images). I have a home button on second view. When pressed I want to show the main view. I can do this if I add the 2nd view as subview

[self.view addSubview:secondViewController.view]

But whenever 2nd view flips to display the 3rd view, I can see the main view while it is flipping.

Now if I add 2nd view as below self.view = secondViewController.view then I dont have the main view to display when the home button is pressed.

How can I hide the main view when 2nd view is flipping to show 3rd view?