• 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: Correct way to specify anchors with NSURL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct way to specify anchors with NSURL?


  • Subject: Re: Correct way to specify anchors with NSURL?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 21 Apr 2016 17:09:41 +1000

> On 21 Apr 2016, at 3:22 PM, Quincey Morris <email@hidden> wrote:
>
> On Apr 20, 2016, at 22:16 , Graham Cox <email@hidden> wrote:
>>
>> But it’s 10.9+ only. I really need a solution that will work back to 10.7 (or 10.8 at the latest).
>
> Then I’d guess you’d need to construct the entire URL as a string first, then use initWithString. Presumably ‘URLByAppendingPathComponent’ %-encodes a # because you’ve told it that your substring is a *path* component. If you give it a whole string, I’d assume it figures out that it’s got a “fragment” at the end.
>
> But I’m just guessing now.
>


Yah, that works. Thanks.

It strikes me that it’s a bug that URLByAppendingPathComponent: doesn’t parse for a fragment just as -initWithString: does though, the anchor/fragment is a perfectly reasonable part of a path and what other possible ambiguious meaning could it have? It makes hard work of something that should be easy.

—Graham



_______________________________________________

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


  • Follow-Ups:
    • Re: Correct way to specify anchors with NSURL?
      • From: Mike Abdullah <email@hidden>
    • Re: Correct way to specify anchors with NSURL?
      • From: Quincey Morris <email@hidden>
References: 
 >Correct way to specify anchors with NSURL? (From: Graham Cox <email@hidden>)
 >Re: Correct way to specify anchors with NSURL? (From: Quincey Morris <email@hidden>)
 >Re: Correct way to specify anchors with NSURL? (From: Graham Cox <email@hidden>)
 >Re: Correct way to specify anchors with NSURL? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Correct way to specify anchors with NSURL?
  • Next by Date: Thoughts on autolayout
  • Previous by thread: Re: Correct way to specify anchors with NSURL?
  • Next by thread: Re: Correct way to specify anchors with NSURL?
  • Index(es):
    • Date
    • Thread