Reputation: 2455
I'm trying to develop a web browser that will display a website after the launch . I already red the articles and with i cant seem to get it to work with this code .
NSURL*url=[NSURL URLWithString:@"http://www.google.com"];
NSURLRequest*request=[NSURLRequest requestWithURL:url];
[[webview mainFrame] loadRequest:request];
I'm using the cocoa and the Webkit Framework .
Upvotes: 1
Views: 7364
Reputation: 56
Try this:
- (void)applicationDidFinishLaunching:(NSNotification *)notification{
NSString *urlText = @"http://google.com";
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
return;
}
if that doesn't work, try this:
- (void)awakeFromNib{
NSString *urlText = @"http://google.com";
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];
return;
}
Good luck! tell me if this works!
Upvotes: 3