a noob question here:
any ideas why this code:
UIViewController* popoverviewController = [[UIViewController alloc]init];
UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[webViewnetwork loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"webView" ofType:@"html"]isDirectory:NO]]];
[popoverView addSubview:webViewnetwork];
popoverviewController.view = popoverView;
popoverviewController.contentSizeForViewInPopover = CGSizeMake (100, 100);
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverviewController];
[self.popoverController presentPopoverFromRect:CGRectMake(0, 0, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
would work fine on iPad, but crash on iPhone ? I'm trying to do the same thing as in my iPad version, which is adding a subview with an html formatted text. It crashes (program received signal: SIGABRT) on the 7th line (initWithContentViewController)
thank you!
You cannot use a UIPopoverController with iPhone. U will need to detect which device idiom u are using and present the appropriate viewController type at runtime.
The project here provides some examples. The basic gist of it is the following:
Good Luck.
Because
UIPopoverController
is only available on the iPad.