AKB
AKB

Reputation: 122

iPad integration

I've started a project using only iPhone as its default device, but now I want to use this project in iPad version also.

I've taken a iPad .xib UIView and all the coding used in didFinishLaunching: method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    } else {
        self.viewController = [[ViewController alloc] initWithNibName:@"ViewControlleriPad" bundle:nil];
    }
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

But as I run the project an error occurs showing this message

2013-03-29 11:59:06.339 animation[800:11303] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewControlleriPad" nib but the view outlet was not set.' * First throw call stack: (0x159b012 0x12a8e7e 0x159adeb 0x2cd8c8 0x2cddc8 0x2cdff8 0x2ce232 0x21d3d5 0x21d76f 0x21d905 0x226917 0x21eb 0x1ea157 0x1ea747 0x1eb94b 0x1fccb5 0x1fdbeb 0x1ef698 0x25fddf9 0x25fdad0 0x1510bf5 0x1510962 0x1541bb6 0x1540f44 0x1540e1b 0x1eb17a 0x1ecffc 0x1e2d 0x1d55) libc++abi.dylib: terminate called throwing an exception

Does anybody knows what is this error??? How can I resolve this? Thanks in advance :-)

EDITED:

Here's my problem https://www.dropbox.com/s/v8xzoj7v7wx04iv/pb.mov

Upvotes: 0

Views: 89

Answers (1)

Madhumitha
Madhumitha

Reputation: 3824

For this error '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewControlleriPad" nib but the view outlet was not set.' go to your xib(nib) right click your view and connect to File owner as shown in figure.This solve your problem. enter image description here

enter image description here

Upvotes: 1

Related Questions