I am having an issue getting UIWebView as an outlet. I've done my research, here are the steps I've taken.
Using XCode 5.0.1
Created a ViewController named WebViewController with XIB
Verified fileowner is WebViewController
added a UIWebView to the xib
set UIWebView delegate to FileOwner WebViewController
modified WebViewController.h, adding
Adding the following methods to WebViewController.m
(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
(void)webViewDidFinishLoad:(UIWebView *)webView
(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
(void)webViewDidStartLoad:(UIWebView *)webView
Create an outlet from UIWebView to myWebView (in the .m file)
As soon as I push the WebViewController I get a NSUnknownKeyException on myWebView.
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WebViewController 0x19ff75a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myWebView.'
IMPORTANT: If I merely remove the outlet to myWebView then I can push the WebViewController fine. Of course I cannot modify the UIWebView though with no outlet.
Any idea what is going on here? I get the same issue in a new/blank project as well.
UPDATE: - So WebViewController.xib FIleOwner custom class is: WebViewController, verified in InterfaceBuilder - Creation at runtime is like this
[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
- Breakpoint set at initWithNibName in WebViewController.m never fires.