I have two nib files. ViewController.xib and NewView.xib.
From inside the viewController of the first nib when I try to execute the following code on click of a button:
NewView *secondView = [NewView alloc] initWithNibName:@"NewView.xib" bundle:nil];
secondView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:secondView animated:YES];
a SIGABRT is sent to the program. (NewView is the second view controller)
but when I replace the first line with:
NewView *secondView = [NewView alloc]init];
it works fine and my second nib is presented as a modal view.
The file’s owner is set as NewView and view is also connected to the file’s owner.
I am very new to iOS and don’t understand why this is happening. Please throw some light.
Actually, I think I know what you need to do. Try replacing
with
I believe I have had this problem before, and it came down to the fact that you are NOT expected to include the extension when loading a xib file.