Friday, October 9, 2009

While trying to add UIWebView. Have the IBOutlet connected and it compiles, but I'm missing something:
2009-10-09 16:04:38.035 Green Splash Theme[2529:20b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myWebView.'
What am I missing?

Tried:

  1. Link the UIWebView's delegate to the file owner;
  2. Make the UIViewController a as well.
  3. Ah-ha! The class that was controlling the UIWebView was a sub-class of another class. In my call to instantiate my new UIWebView class, I used the parent class instead. Changing it to the more specific class made it work.
That is, I had:
vcCtrl = [[ParentDialog alloc] initWithNibName:@"WebDialog" bundle:nil];

when it should have been:
vcCtrl = [[WebDialog alloc] initWithNibName:@"WebDialog" bundle:nil];

where WebDialog inherited from ParentDialog. Inheritance is a tricky little bugger if you're not paying attention.

No comments: