Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:14:28+00:00 2026-06-14T05:14:28+00:00

Possible Duplicate: XCode 4.5.1, Application windows are expected to have a root view controller

  • 0

Possible Duplicate:
XCode 4.5.1, Application windows are expected to have a root view controller at the end of application launch

I’m a total noob in IOS app developing.

I use Xcode 4.5.1 with no storyboard.

I’m upgrading an IOS 4 app because it fails to run correctly on IOS 6 devices.
main view containing a question and five answers run once and stops there after user commit by pressing a button with the wanted answer, it should then reload itself with a new question and a new set of questions.

I get the infamous “Application windows are expected to have a root view controller at the end of application launch” in log output.

I’ve read and tried all comments and solutions in 7520971 but to no avail… still getting error and it seems to prevent me to load the view correctly.

here’s what in my appDelegate.h

/*
 *  AnimViewAppDelegate.h
 *  AnimView
 *
 *  Created by Administrateur local on 11-01-19.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */


#import <UIKit/UIKit.h>
#import "RootNavigationController.h"

@interface PPScaleAppDelegate : NSObject <UIScrollViewDelegate> {
    UIWindow *window;
    RootNavigationController *RootNavigationViewController;
}
@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) RootNavigationController *RootNavigationViewController;
@end

my appDelegate.m

//
//  AnimViewAppDelegate.m
//  AnimView
//
//  Created by Administrateur local on 11-01-19.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "PPScaleAppDelegate.h"
#import "QuestionView.h"

@implementation  PPScaleAppDelegate
@synthesize window;
@synthesize RootNavigationViewController;

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

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    //Create the main screen
    //CGRect frame = [[UIScreen mainScreen] bounds];
    //self.window = [[UIWindow alloc] initWithFrame:frame];
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; //2012


    //Create the main view controller
    RootNavigationViewController = [[RootNavigationController alloc] initWithNibName:NULL bundle:NULL];
    //[window addSubview:RootNavigationViewController.view];

    [self.window setRootViewController:RootNavigationViewController];

    //Show the main window
    [self.window makeKeyAndVisible];

    return YES;
}

- (void)dealloc {
    [window release];
    [super dealloc];
}

@end

.h

//
//  RootNavigationController.h
//  IPhonePPS
//
//  Created by Administrateur local on 11-02-11.
//  Copyright 2011 Le Groupe CDGI Inc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "QuestionView.h"
#import "ResultView.h"
#import "ResultTableView.h"


@interface RootNavigationController : UINavigationController {

    QuestionView *QuestionViewController;
    ResultView *ResultViewController;
    ResultTableView *ResultTableViewController;

}
@property(nonatomic, assign) QuestionView *QuestionViewController;
@property(nonatomic, assign) ResultView *ResultViewController;
@property(nonatomic, assign) ResultTableView *ResultTableViewController;

-(void)switchToResultMode:(QuestionPath *)QuestionPath;
-(void)switchToResultTableMode;
-(void)switchBack:(BOOL)Reset;
@end

.m

//
//  RootNavigationController.m
//  IPhonePPS
//
//  Created by Administrateur local on 11-02-11.
//  Copyright 2011 Le Groupe CDGI Inc. All rights reserved.
//

#import "RootNavigationController.h"

@implementation RootNavigationController
@synthesize QuestionViewController, ResultViewController, ResultTableViewController;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:nibBundleOrNil {

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {

        // Initialization code.
        QuestionViewController = [[QuestionView alloc] initWithNibName:NULL bundle:NULL];
        ResultViewController = [[ResultView alloc] initWithNibName:NULL bundle:NULL];
        ResultTableViewController = [[ResultTableView alloc] initWithNibName:NULL bundle:NULL];

        //Set the navigation bar hidden
        [self setNavigationBarHidden:YES];

        //Push the question view on the stack
        [self pushViewController:self.QuestionViewController animated:YES];

    }
    return self;
}

- (void)dealloc {
    [super dealloc];
}

-(void)switchToResultMode:(QuestionPath *)QuestionPath {
    [self pushViewController:ResultViewController animated:YES];
    [ResultViewController setQuestionPath:QuestionPath];
}

-(void)switchToResultTableMode {
    [self pushViewController:ResultTableViewController animated:YES];
}

-(void)switchBack:(BOOL)Reset{
    if(Reset){
        if([self.viewControllers count] == 3){
            [self popToRootViewControllerAnimated:YES];
        }else {
            [self popViewControllerAnimated:YES];
        }
        [QuestionViewController resetAnswers];
    }else {
        [self popViewControllerAnimated:YES];
    }
}

//-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
//  if([self visibleViewController] == self.ResultTableViewController || toInterfaceOrientation == UIInterfaceOrientationPortrait){
//      return YES;
//  }else {
//      return NO;
//  }
//}

- (BOOL) shouldAutorotate {
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

@end

spent two complete days trying to debug this but I give up and would really appreciate your help with this issue

PR

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:14:29+00:00Added an answer on June 14, 2026 at 5:14 am

    It would be better to just use [[alloc] init] if you don’t have a nib for your navigation controller. Also, your navigation controller should be initialized with its own rootViewcontroller. I don’t know which one you want to be first, but it should look something like this:

      MyFirstViewControllerClass *rootVC = [MyFirstViewControllerClass alloc] initWithNibName:@"MyFirstViewController" bundle:nil];
      RootNavigationController *nav = [[RootNavigationController alloc]initWithRootViewController:rootVC];
      self.window.rootViewController = nav;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Xcode: Storyboard Tabbed Application Passing Data Back and Forth Basically I have
Possible Duplicate: Cannot find window-based application on XCode I am pretty new to IOS
Possible Duplicate: iPhone development on Windows Obviously i don't have a Mac machine. But
Possible Duplicate: iOS 6 Xcode 4.5 unsupported architecture armv7s I'm going to upload my
Possible Duplicate: iOS 6 Xcode 4.5 unsupported architecture armv7s I am planning to submit
Possible Duplicate: Procedure to submit iPhone application to App Store? Its my first IOS
Possible Duplicate: crashing on ios device while navigation using UIModalTransitionStylePartialCurl in xcode 4 HI
Possible Duplicate: Xcode 4.3 for Snow Leopard Do we have Xcode 4.3 available for
Possible Duplicate: iOS 5.1 with Xcode 4.3.1: [UIColor colorWithPatternImage:] strange behavior only on device
Possible Duplicate: ios 5.1 with xcode 4.2 for iOS development I updated my iPhone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.