I'm trying to use a WebView object to display a web page, but my program ends up crashing (The Debugger has exited due to signal 2 (SIGINT)) while the page is loading. Here's what my .h and .m files look like...
My UI consists of a window with a scrollView in it, and a WebView inside the scroll view. I also have a single button that will call 'setupView' when clicked, and my program crashes when I try and load something like nba.com. If I try to load google.com, though, it works fine.
I ran this in the debugger and put a breakpoint at the 'setMainFrameURL' line. When I get there and 'continue', the program crashes and gives me this message:
I have added the WebKit.framework and JavaVM.framework into my project, but I still get the error above.
I checked, and the /System/Library/Fr..../JavaPluginCocoa file does exist on my machine.
Another funny thing I don't quite understand... If I run this in the debugger with the breakpoint described above, hit 'c' at the breakpoint, I get the message above. The debugger is now at the '(gdb)' prompt, and if I hit 'c' again, I get the 'Continuing' message in the debugger and my page finishes loading and my program seems to work fine. However, whenever I run it without debugging, it will crash.
Anybody know what I'm doing wrong here? Any help would be greatly appreciated.
Thanks.
Code:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebView.h>
@interface AppController : NSObject {
IBOutlet WebView *webView;
}
- (IBAction)setupView:(id)sender;
@end
Code:
#import "AppController.h"
@implementation AppController
- (id)init
{
[super init];
webView = [[WebView alloc] init];
return self;
}
- (IBAction)setupView:(id)sender
{
NSString *urlString = @"http://www.nba.com";
// NSString *urlString = @"http://google.com";
[webView setMainFrameURL:urlString];
}
@end
My UI consists of a window with a scrollView in it, and a WebView inside the scroll view. I also have a single button that will call 'setupView' when clicked, and my program crashes when I try and load something like nba.com. If I try to load google.com, though, it works fine.
I ran this in the debugger and put a breakpoint at the 'setMainFrameURL' line. When I get there and 'continue', the program crashes and gives me this message:
Code:
(gdb) c
Continuing.
Current language: auto; currently objective-c
=shlibs-removed,shlib-info=[num="101",name="JavaPluginCocoa",kind="B",dyld-addr="0x15eea000",reason="dyld",requested-state="E",state="E",path="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/JavaPluginCocoa.bundle/Contents/MacOS/JavaPluginCocoa",description="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/JavaPluginCocoa.bundle/Contents/MacOS/JavaPluginCocoa",loaded_addr="0x15eea000",slide="0x15eea000",prefix=""]
Debugger() was called!
(gdb)
I have added the WebKit.framework and JavaVM.framework into my project, but I still get the error above.
I checked, and the /System/Library/Fr..../JavaPluginCocoa file does exist on my machine.
Another funny thing I don't quite understand... If I run this in the debugger with the breakpoint described above, hit 'c' at the breakpoint, I get the message above. The debugger is now at the '(gdb)' prompt, and if I hit 'c' again, I get the 'Continuing' message in the debugger and my page finishes loading and my program seems to work fine. However, whenever I run it without debugging, it will crash.
Anybody know what I'm doing wrong here? Any help would be greatly appreciated.
Thanks.