-1

I am using custom tabbar without the tabbar controller. When I try to add the viewController using

[self presentModalViewController:controller animated:YES];

edit: changed to presentsModalViewController.

which is for MFMailComposeViewController it works fine but it also removes the tabbar when I dismiss it.

For solution I had to present the controller on appDelegate.viewController like:

[APPDELEGATE.navigationController presentModalViewController:controller animated:YES];

edit: changed to presentsModalViewController.

This works fine and don't remove the tabbar. But the issue is when the iphone get locked after getting idle and I try to present the controller using this:

[APPDELEGATE.navigationController presentModalViewController:controller animated:YES];

edit: changed to presentsModalViewController.

It does not work.
In debug mode the code is executing but it is not presenting the viewController.

Many Thanks.

Naveed Rafi
  • 2,503
  • 5
  • 32
  • 40

2 Answers2

1

if you copied the Code right then you use
[APPDELEGATE.viewController dismissModalViewControllerAnimated:YES];
instead of
[APPDELEGATE.viewController presentsModalViewController:YOURVIEWController Animated:YES]; on the second call

Seega
  • 3,001
  • 2
  • 34
  • 48
0

I have fixed it myself. The problem was I was reallocating the navigation controller in the

- (void)applicationDidBecomeActive:(UIApplication *)application

Thanks.

Naveed Rafi
  • 2,503
  • 5
  • 32
  • 40