Why viewWillAppear is not called in my UITabBArController when i use presentModelViewController?
My app is a view based application. I made a login view and if user enters right username and password i go to main menu which is a UITabViewController like this:
MainMenuController *mainMenu = [[[MainMenuController alloc] init] autorelease];
[mainMenu setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:mainMenu animated:YES];
mainMenu has 4 tabs with these names: Menu, History, Settings, Music.
when i click on tabs then viewWillAppear of view attached with that tab should be called. But its not calling viewWillAppear of any tab. In Menu tab i am generating a tableView when a button is clicked like this:
[self p开发者_JAVA百科resentModalViewController:sel animated:YES];
and when any row of the table is tapped i call this:
[self dismissModalViewControllerAnimated:YES];
so that table view goes away. Strange thing is after this is done, viewWillAppear is called for every view attached to tab bar. Then when i switch between tab bar views then viewWillAppear for every view is called. Why is that so and is there any way that viewWillAppear of every view attached with TabBarController will be called without calling new tableView? Thanks in advance
You did not answered my question, but ok. Try this, put your menu tab as the second one. See if the viewWillAppear
is called now.
精彩评论