Exception : this class is not key value coding-compliant for the key
On my IPhone application, I want to show a view when there’s no internet connection. (faking by opening a non existing url) .
But, I get the following exception in the console :
Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<NoInternetViewController 0x5159e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myViewOutlet.’
Here’s the code :
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
@try {
[[NSString alloc] initWithContentsOfURL:@”http://urldoesntexist…”];
[window addSubview:viewController.view];
} @catch (NSException* ex) {
[viewController.view removeFromSuperview];noInternetViewController = [[NoInternetViewController alloc] initWithNibName:@”NoInternetConnection” bundle:nil];
[window addSubview:noInternetViewController.view];}
[window makeKeyAndVisible];}
The Exception occures on the [window makeKeyAndVisible];
What could be the problem ?
Find accessories for your iPhone at the Cell Phone Shop.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
