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

  • SEARCH
  • Home
  • 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 695151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:55:48+00:00 2026-05-14T02:55:48+00:00

I am trying to load my UIViewController and corresponding UIView programmatically in the AppDelegate

  • 0

I am trying to load my UIViewController and corresponding UIView programmatically in the AppDelegate class. I have the following in the applicationDidFinishLaunchingMethod of the AppDelegate class:

  • (void)applicationDidFinishLaunching:(UIApplication *)application {
    NSLog(@”— AppDelegate applicationDidFinishLaunching Start”);

    // Override point for customization after application launch
    //MainController *controller = [[MainController alloc] initWithNibName:@”MainView” bundle:nil];
    MainController2 *controller = [[MainController2 alloc] initWithNibName:@”MainView2″ bundle:nil];

    if (controller.view == nil)
    {
    NSLog(@”— controller view is nil!!!!!!”);
    }
    [window addSubview:controller.view];
    [window makeKeyAndVisible];

    NSLog(@”— AppDelegate applicationDidFinishLaunching End”);
    }

Basically the view in the viewController doesn’t load and when the application launches, it just shows the blank window. What is funny is that it worked before and then just stopped working. I am wondering if this is a bug in iPhone SDK 3.1.3??? This is a really annoying issue, and I was quite a ways along in a new project when I started having this problem and had to start over with a blank project and copy over all of my resources, when it started happening again… I have uninstalled iPhone OS 3.1.3 and reinstalled and the problem prevails…

I also created a second UIViewController class and corresponding nib which DOES LOAD just fine… I am not sure why one works and the other doesn’t it…

You can download a sample project which demonstrates this issue at the following link:

http://www.mediafire.com/?nmhnmhbeyki

To switch back and forth between the working/nonworking UIViewController and UIView simply comment comment/comment out the initWithNibLine lines in the AppDelegate and the corresponding #import “MainController.h” statements in the appdelegate.h file…

Any ideas???

The sample project I have linked to isolates the problem in as few files/lines of code as possible… I appreciate any help you might be able to provide.

Thanks,
James

  • 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-05-14T02:55:48+00:00Added an answer on May 14, 2026 at 2:55 am

    MainController is overriding “loadView”, but its “loadView” implementation does not actually load anything (or call [super loadview]). Hence, no view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 540k
  • Answers 540k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If not all elements of the matrix are occupied (or… May 17, 2026 at 2:44 am
  • Editorial Team
    Editorial Team added an answer You should compare the strings with - (BOOL) isEqualToString or… May 17, 2026 at 2:44 am
  • Editorial Team
    Editorial Team added an answer Without testing, the basic transcription would be something like this:… May 17, 2026 at 2:44 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a UIViewController that I want to load from a NIB that has
I'm trying to load the DOM of web pages in my application (running under
I'm trying to load a view controller from a nib in Interface Builder. My
Does my code look right? I'm trying to load data into my table view
I'm trying to figure out what logic should go into the different UIViewController methods
I have a scrollview I'm trying to add ViewControllers to from a nib file.
Im trying to load an xml file using the jquery ajax function,it works fine
I'm trying to load pickled objects in iPython. The error I'm getting is: AttributeError:
I'm trying to load some decimal values from a file but I can't work
I'm trying to load an m3u8 file that's saved to the local filesystem, but

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.