views:

22

answers:

1

Hi guys,

I am new to iphone app development. I have created a simple app based in tab bar controller.

In my app I have 4 tab bar item, all of them loading view from XIB file. Everything works fine.

But my problem is my first tab item is name home, it contains 2 buttons in its view, if buttons are tapped a new sub view loaded from xib file.

At this moment if user select Second tab bar item which named product info and then again select first tab bar item (home) my app displays only sub views of first tab item (home) not the main view or super view of first tab item(home).

How do i get main view or super view every time when first tab item (home) is selected?

please give me some idea..

Thanks

A: 

hi guys,

i think i have got it. I use the bellow codes in .m file

  • (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    // hide all sub views

    [subView removeFromSuperview];

    // My custom code here }

thnaks