Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView not loading with .xib
    text
    copied!<p>For my iphone app, I am setting up a <code>tabBarContoller</code> with one of the tabs displaying a webView (<code>PDFViewController</code>). </p> <p>The problem I am running into is <code>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PDFViewController" nib but the view outlet was not set.'</code></p> <p>ok, I can set up this webView no problem in another project of mine with a storyboard, so I know the issue is with the <code>nib</code> file.</p> <p>In my app delegate I set up the VC (so I can place it in the <code>tabBarController</code></p> <pre><code>PDFViewController *pdfVC = [[PDFViewController alloc] initWithNibName:nil bundle:nil]; pdfVC.tabBarItem.image = [UIImage imageNamed:@"second"]; NSArray *controllers = [NSArray arrayWithObjects:frontPageNavController, campusNavController, opinionNavController, sportsNavController, pdfVC, nil]; self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = controllers; </code></pre> <p>In my .xib I just have a view set up.</p> <p>here is my <code>PDFViewController.m</code> :</p> <pre><code>@implementation PDFViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:@"PDFViewController" bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)]; NSURL *targetURL = [NSURL URLWithString:@"http://issuu.com/miamistudent/docs"]; NSURLRequest *request = [NSURLRequest requestWithURL:targetURL]; [webView loadRequest:request]; [self.view addSubview:webView]; } </code></pre> <p>Any idea what could be causing this error? I tried setting up a normal ViewController in my PDFViewController.xib - but that didnt seem to help any. Thanks !</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload