• 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: -[NSURL path] returning empty string for relative file URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSURL path] returning empty string for relative file URL


  • Subject: Re: -[NSURL path] returning empty string for relative file URL
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 11 Nov 2005 09:12:51 -0800


On Nov 11, 2005, at 6:45 AM, Glen Simmons wrote:

Well, I'm not creating the NSURL in this case, the NSTextView is. I'm shoving some XHTML into the NSTextView and it's interpreting anchors as clickable links. When clicked, my textView:clickedOnLink:atIndex: method gets called with the NSURL in question. The original XHTML had this:
<a href="foo.bar"><span>Link to foo.bar</span></a>
But if I shove it into the NSTextView like that, the NSURL I get back looks like this:
applewebdata://108AB768-64CD-41CF-94FA-C4558EBA0B1E/foo.bar
which is a bit difficult to deal with.



In that case, I think what you want is to specify the base URL in your document options when you create the attributed string, using NSBaseURLDocumentOption. Without a base URL, the initWithData... method can't properly interpret relative URLs.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: -[NSURL path] returning empty string for relative file URL
      • From: Glen Simmons <email@hidden>
References: 
 >-[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Rob Mayoff <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Niko Matsakis <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Niko Matsakis <email@hidden>)
 >Re: -[NSURL path] returning empty string for relative file URL (From: Glen Simmons <email@hidden>)

  • Prev by Date: Re: How to resolve conflict between 2 NSPanels?
  • Next by Date: Re: -[NSURL path] returning empty string for relative file URL
  • Previous by thread: Re: -[NSURL path] returning empty string for relative file URL
  • Next by thread: Re: -[NSURL path] returning empty string for relative file URL
  • Index(es):
    • Date
    • Thread