Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

peacetrain67

macrumors member
Original poster
Dec 20, 2007
68
0
I am trying to open my application to a ModalViewController (a log in page) opposed to the TabBarController that navigates the whole application. I have this code in the appdelegate:

- (void)applicationDidFinishLaunching:(UIApplication *)application
{
LoginViewController *startapp = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:startapp];
}

I am getting a warning that reads "warning:'AppNameAppDelegate' may not respond to '-presentModalViewController:' (Messahes without a matching method signature will be assumed to return 'id' and accept '...' as arguments.) The applications quits unexpectedly when I build and run.

On top of all this, I believe I need to add: [window addSubview:tabBarController.view]; somewhere in the same location, but obviously there could be hitches adding these two commands together. Please and thankyou for the help.
 
self is an AppNameAppDelegate and presentModalViewController: is an instance method of UIViewController, so you're calling it on the wrong class of object. Plus, the method you really want is presentModalViewController:animated:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.