One Quickie


Opening webview links in the user's default browser. (WebKit->General)
...
  [someWebView setPolicyDelegate: self];
...

- (void) webView:(WebView *)webView
decidePolicyForNavigationAction:(NSDictionary *)actionInformation
         request:(NSURLRequest *)request
           frame:(WebFrame *)frame
decisionListener:(id)listener {
    NSURL *url = [request URL];
    if (url != nil) {
        [[NSWorkspace sharedWorkspace] openURL:url];
    }

}  // decidePolicyForNavigationAction



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com