itdeeps
itdeeps

Reputation: 277

iphone app not working ipad simulator

My iphone app runs on iphone simulator and devices but not on ipad simulator. It doesnt showing any errors but the application is not launching just blank black screen only displays.

While running in ipad simulator 5 it showing following error "applications are expected to have a root view controller at the end of application launch"

My application didFinishLaunchingWithOptions code is as below :

rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
[self.rootViewController.view setFrame:CGRectMake(0, 20, 320, 460)];
[self.window addSubview:self.rootViewController.view];

[self.window makeKeyAndVisible];
return YES;

And my main.m code is as below :

 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;

What is the wrong with this???

Upvotes: 2

Views: 1148

Answers (3)

Devaski
Devaski

Reputation: 431

Check....Navigation Controller delegate must have been connected (delegate > AppDelegate) in IB.

Upvotes: 0

Himanshu Agnihotri
Himanshu Agnihotri

Reputation: 2360

Go on the App Target info and set "Target device Family":"iPhone" then it works fine both on iphone and ipad simulator and device both.

Upvotes: 1

Winston Ewert
Winston Ewert

Reputation: 45039

What if you change this:

rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];

to this:

self.rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];

Upvotes: 0

Related Questions