While trying to run my tab-bar app
with many different features such as UITableView
and mapview
with a annotation, I recently added a webview
on my first tab in my firstviewcontroller
. As far as I know, there's nothing wrong with the coding there, though ever since I tried adding the webview on my first tab I keep getting the breakpoint/error
while trying to run the app : Thread 1: signal SIGBRT.
I've read around some, and someone said that if I change mi xib file /storyboard's deployment to iOS 5.0 instead of 6.0 (wich I'm currently using) and not having "Use Autolayout"
checked it should get rid of it. Though It didn't. Any thoughts or solutions to this?
Here's the coding for my firstviewcontroller.h
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@end
firstviewcontroller.m
#import "FirstViewController.h"
@interface FirstViewController ()
@end
@implementation FirstViewController
@synthesize webView;
- (void)viewDidLoad
{
NSString *website = @"http://www.google.com";
NSURL *url = [NSURL URLWithString:website];
NSURLRequest *requestUrl = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestUrl];
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end
main.m :
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); // <--- HERE's where it says SIGBRT
}
}
All output:
2013-01-04 11:27:06.697 My Corp[784:13d03] Unknown class ViewController in Interface Builder file.
2013-01-04 11:27:06.716 My Corp[784:13d03] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FirstViewController 0x808fbf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myWebView.'
*** First throw call stack:
(0x1800012 0x11c5e7e 0x1888fb1 0xc72711 0xbf3ec8 0xbf39b7 0xc1e428 0x32a0cc 0x11d9663 0x17fb45a 0x328bcf 0x1ede37 0x1ee418 0x1ee648 0x1ee882 0x20fed9 0x20fd14 0x20e1ea 0x20e06c 0x20c1cc 0x20c9b6 0x1f0753 0x1f0a7b 0x1f1964 0x154877 0x15b5a3 0x153eed 0x13db56 0x13ddbf 0x13df55 0x146f67 0x10afcc 0x10bfab 0x11d315 0x11e24b 0x10fcf8 0x1cc9df9 0x1cc9ad0 0x1775bf5 0x1775962 0x17a6bb6 0x17a5f44 0x17a5e1b 0x10b7da 0x10d65c 0x289d 0x27c5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
The mistake you have done was clearly stated in the crash report
[<FirstViewController 0x808fbf0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myWebView.'
To solve that go to your XIB
of that Class right click on the File owner
located on the left side pane of InterfaceBuilder. You will find an object with name myWebView
with yellow warning icon, click remove on that outlet connection and compile your code. You have connected the outlet and later you remove the IBOutlet in the code and forget to remove the connection in the XIB.