• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Clicking links in webview does nothing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clicking links in webview does nothing


  • Subject: Re: Clicking links in webview does nothing
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 30 May 2010 09:47:55 -0700

On May 30, 2010, at 5:00 AM, Nava Carmon wrote:

> I have a webView in my cocoa application. For some reason clicking on hyperlinks there does nothing. I created it in IB and it loads and show the remote html properly. When I roll over links, the cursor changes to hand, but when i click on them nothing happens.

I’m guessing that the page’s HTML specifies that the links should open in a new window. The WebView can’t do that itself, so it calls a delegate method to tell you to create a new window. If you haven’t implemented that delegate method, nothing happens. I can’t remember offhand which of the many WebView delegate APIs it is; look through them in the reference and it should be pretty clear which one.

> Actually I'd like to open them in default browser window. What is the way to do that?

It’s trivial: the delegate method will hand you an NSURL, so just tell NSWorkspace to open it for you.

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Clicking links in webview does nothing (From: Nava Carmon <email@hidden>)

  • Prev by Date: Re: Stealing settings from Mail.app
  • Next by Date: Re: UTI strings
  • Previous by thread: Clicking links in webview does nothing
  • Next by thread: UTI strings
  • Index(es):
    • Date
    • Thread