Re: WebView open URL upon launch of application? (Having issues)
Re: WebView open URL upon launch of application? (Having issues)
- Subject: Re: WebView open URL upon launch of application? (Having issues)
- From: Erik Stainsby <email@hidden>
- Date: Sat, 28 Jul 2012 13:23:40 -0700
I suspect you may be trying to loadRequest: too early in the life cycle of the webView. Have you tried arranging things to exec -loadRequest: in the applicationDidFinishLaunching: ?
~ Erik
On 2012-07-28, at 1:16 PM, Tom Miller <email@hidden> wrote:
> 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
> email@hidden
> pxlc.me
>
> _______________________________________________
> 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
_______________________________________________
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