user175832
user175832

Reputation:

Unable to load UIView with initWithNibName in Apple SDK 3.1.3

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:

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

Upvotes: 0

Views: 1634

Answers (1)

David Gelhar
David Gelhar

Reputation: 27900

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

Upvotes: 1

Related Questions