Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I need to fill UIViewController with UIWebView dynamically. I am using the UIWebviewController to load automatically on iPhone and iPad. I am using a UINavigationController to push the UIViewController on to the screen.

Here is what I had done

in the view controller code ( in *.h )

@property (weak, nonatomic) IBOutlet UIWebView *webview;

( in *.m file )

@synthesize webview;

( in viewDidLoaded method )

self.webview = [[UIWebView alloc] initWithFrame:self.view.bounds];
self.webview.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
self.webview.delegate = self;
[self.view addSubview:self.webview];

I am pushing the viewcontroller like this

CommonViewController *commonController = [CommonViewController alloc] initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:commonController animated:YES];

I am getting exception

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "CommonViewController" nib but the view outlet was not set.' *

can anyone tell me what is causing the exception. I have added the webview to view, I am not sure what to do next !!!

share|improve this question

1 Answer

up vote 1 down vote accepted

Read this post: Loaded nib but the view outlet was not set - new to InterfaceBuilder

You forgot to do this step: You should see "outlets" with "view" under it. Drag the circle next to it over to the "view" icon on the left bar (bottom one, looks like a white square with a thick gray outline

Hope this helps you...

share|improve this answer
Yes that the thing missing !!! – CodeWeed 21 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.