0

This code, using a xib, is working perfectly without any errors or exceptions.

- (id)initWithPageNumber:(int)page
{
    self = [super initWithNibName:@"MyViewController" bundle:nil];
    if (self !=nil)
    {
        pageNumber = page;
        NSLog(@"=====%@",pageNumberLabel);
    }
    return self;
}

Then I tried this code using storyboards, and I got an exception

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/Balu/Library/Application Support/iPhone Simulator/7.0.3/Applications/973E52E9-0923-49A0-B4A6-212BC5F367CD/scrollpages.app> (loaded)' with name 'MyViewController''

Can anyone explain to me how to write this line of code for use with a storyboard?

self = [super initWithNibName:@"MyViewController" bundle:nil];
jscs
  • 63,694
  • 13
  • 151
  • 195
S P Balu Kommuri
  • 890
  • 10
  • 28

0 Answers0