Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebView question




On Feb 9, 2006, at 4:10 PM, Matt Mashyna wrote:

I have a window with a WebView in it. When the app loads I can tell it's controller to load it and open a url in applicationDidFinishLaunching.

Works fine. I can change to that window any time and click links etc. but I don't want to open this window at launch time. The app is a sort of wizard that goes through steps and has a few threads doing things like connecting to http and ftp servers. When the steps are complete, I want to pop up the window with the WebView and tell it to load a specific URL that might not be known until right before it's needed to load. When I try to load a URL later -- one that works fine when done in applicationDidFinishLaunching -- nothing happens. I don't get an exception.

When I try opening a URL from another thread it also fails quietly. Something is wrong with the way I want to load it. Do you have to make calls to webkit from the main thread ?

Absolutely - UI needs to always be done from the main thread.

One other thing to look into is how are you displaying the window housing the WebView - if it is run in a modal run loop (e.g., "runModalForWindow", etc..), there won't be any time given to the WebView to finish loading the URL content. You'll need to break that modal loop into an explicit begin/run (like shown in runModalSession) and give time to the default run loop...



Glenn Andreas                      email@hidden
 <http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >WebView question (From: Matt Mashyna <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.