Simple Problem With ModalViewController

Discussion in 'iOS Programming' started by peacetrain67, Jul 14, 2009.

  1. peacetrain67 macrumors member

    Dec 20, 2007
    I am trying to make my application launch to a modalviewcontroller, but am getting an error stating the ModalViewController is undeclared (see the picture). How can I declare it is, as it wants me to do?

    I want the modalviewcontroller to be called (as a log in screen with some other various options), then once it is loaded, it will have a button i have already assigned to dismiss it. After the dismissal, I want the tabbarcontroller to be shown, which I believe it is:

    - (void)applicationDidFinishLaunching:(UIApplication *)application {

    // Add the tab bar controller's current view as a subview of the window
    [window addSubview:tabBarController.view];
    LoginViewController *startapp = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
    [presentModalViewController:startapp Animated:YES];

    Attached Files:

  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    You simply can't do what you are trying to do. It is clear that you need to go back to the start and learn the basics of Objective-C. And Objective-C method call has the form:

    [targetObject methodName:param ...]
    You call is missing a targetObject (or Class object if it is a class rather than instance method). This is a basic and fundamental error.

Share This Page