Search code examples
iphoneobjective-ccocoa-touchios4viewwillappear

How to present a UIViewController on viewWillAppear Event of a different UIViewConroller in iPhone SDK?


In my iPhone app, I have a requirement to present a new UIViewController on viewWillAppear event of a different UIViewController based on the condition.

Actually I am trying to check whether user has logged in or not. I am trying something similar to what is present in eBay's iPhone app. How can I do that?


Solution

  • I got the answer. We cannot present a View on -(void)viewWillAppear:(BOOL)animated of a different viewController.

    We have to add code for presenting a View on -(void)viewDidAppear:(BOOL)animated method.