WebView open URL upon launch of application? (Having issues)
WebView open URL upon launch of application? (Having issues)
- Subject: WebView open URL upon launch of application? (Having issues)
- From: Tom Miller <email@hidden>
- Date: Sat, 28 Jul 2012 16:16:21 -0400
I found this snippet while looking for a way to launch a URL in WebView upon launch of an application. The code is running and building properly with the application, but the URL doesn't process in the WebView once the application opens. The Object I assigned to the 'window' and 'webView' are connected properly, so I'm very confused on why this won't load the URL. Any idea why this is happening?
@interface ViewController: NSObject {
NSWindow *window;
IBOutlet WebView *webView;
}
@property (assign) IBOutlet NSWindow *window;
@property (nonatomic, retain) IBOutlet WebView *webView;
@end
@implementation ViewController
@synthesize window;
@synthesize webView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
}
- (void)awakeFromNib {
NSString *resourcesPath = [[NSBundle mainBundle] resourcePath];
NSString *htmlPath = [resourcesPath stringByAppendingString:@"http://www.google.com"];
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlPath]]];
}
--
-
Tom Miller
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden