Mailing Lists: Apple Mailing Lists

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

Weird WebView Blocking



I’m having a strange issue with my WebView. I’ve created a WebView in a NIB file which I load dynamically at run-time. Because of the way my functions have to operate, I’m launching the window, loading the WebView, and trying to drop into a CFRunLoop (via CFRunLoopRun()) until the window is dismissed. However, CFRunLoopRun() exits immediately - as if there’s no input sources for the currently running runloop. I tried achieving similar results by calling netEventMatchingMask: on the window but the same thing happens - there are no events and it exits immediately. As a third attempt, I set up a while loop to call CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10000, true) until I set a Boolean indicating the transfer was done. This allowed the webview to load up, but the view will not receive any events. The scroll bar doesn’t work, the window’s close button doesn’t work - the only thing I can do is drag the window !
 around the desktop. Is the WebView setting up its own RunLoop or messing with the existing one? I’m confused as to why CFRunLoop and the nextEvent methods aren’t working. I’ve also tried NSRunLoop runMode: with the same results.

My pseudo code looks something like this:

…
[NSBundle loadNibNamed:@”WebViewNib” owner:self];
<create URL Request for the page I want to load>
[_window makeKeyAndOrderFront:self];
[_webView setFrameLoadDelegate:self];
[[_webView mainframe] loadRequest:postRequest];
…
CFRunLoopRun(); ←This call exits immediately.

Likewise, the following just sits there in the loop and never exits nor allows any events in the window:
While(!_webViewDone && [[NSRunLoop currentRunLoop] runMode:NSDefaultMode beforeDate:[NSDate distantFutuer]])
{
}

Is there something goofy with the way I'm loading the window or calling the runloop? Could there be something I’m missing in the NIB file (this isn't an application so it doesn't have a typical NIB file...but my class IS the File's Owner)? Any help would be appreciated!

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

This email sent to 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.