ModalViewController goes to background on application start
I am migrating my app code base to iPhone SDK 4. In one of the screens I use
-(IBAction) LoadSearch {
MySearchViewController *mySearchController=[[MySearchViewController alloc] initWithNibName:@"MySearchViewController" bundle:nil];
[self.navigationController presentModalViewController:mySearchController animated:YES];
}
That launc开发者_StackOverflow中文版hes the ModalViewController. While the Modal is open, if the user clicks home button, the application goes to suspended state.
If I relaunch the application, immediately after launch the Modal becomes invisible. It seems like the Modal goes to the background of navigationController views.I can see the modal when I rotate the iphone to landscape mode (the modal is being rotated appropriately).
Has any one seen this issue before? Any suggestions are appreciated.
Solved this issue my self.
I was calling the [window addSubview:tabBarController.view] in applicationDidBecomeActive.
So, this resulted in adding tabBarController.view to the window and any modalViewControllers are pushed to background.
精彩评论