moomoo
moomoo

Reputation: 77

XIB popover display

I seem to be having trouble making a popover xib display when app is loaded. Here is what I have in the ViewDidLoad.I am sorry, I am new to this was looking into tutorials and ran into a problem where the app crashes. The error log is "Terminating app due to uncaught exception 'NSException', reason: 'Could not load NIB in bundle:" "(loaded)' with name 'search''

     ViewController* viewController2 = [[ViewController alloc] initWithNibName:@"search" bundle:nil];
self.popOverController = [[UIPopoverController alloc] initWithContentViewController:viewController2];

_popOverController.popoverContentSize = CGSizeMake(350,100);

Upvotes: 0

Views: 1784

Answers (2)

Mehdi
Mehdi

Reputation: 974

look at this.

It says that your nib 'search' does not exist in the builded app. Either your xib is not named "search.xib" or your xib is not included into your project. YOu can check this by looking into the .app-directory on your phone or simulator.

Upvotes: 0

rdelmar
rdelmar

Reputation: 104082

You need to present it somehow. The code you show just creates the popover. You need to use either presentPopoverFromRect:inView:permittedArrowDirections:animated: or presentPopoverFromBarButtonItem:permittedArrowDirections:animated: to actually show it.

Upvotes: 1

Related Questions