• 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: Using an anchor in NSURL file url
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using an anchor in NSURL file url


  • Subject: Re: Using an anchor in NSURL file url
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 21 Jan 2016 17:32:28 -0800
  • Feedback-id: 167118m:167118agrif8a:167118s6scXNCOpz:SMTPCORP

On Jan 21, 2016, at 17:17 , Jeff Evans <email@hidden> wrote:
>
> 	In OSX I'm using an NSURLRequest to load a file url in WKWebView. Works fine unless I try to add an anchor to the path, for example,
>
> [path]/filename.html#anchorname
>
> The problem appears to be that the # gets escaped to #.

Can you show what APIs you’re using for this? Are you appending the anchor to an existing string or URL? Are you explicitly creating a file URL, or a generic URL?

Looking at NSURL documentation, it looks like NSURL recognizes the anchor as a piece called “fragment”.

> I tried [NSURL URLWithString: anchorname relativeToURL: baseURL] but this produces a url with the form

This doesn’t seem likely to work. In this API, the first parameter is assumed to *be* a URL, albeit in relative form, not a URL piece, which is what you have.

_______________________________________________

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: Using an anchor in NSURL file url
      • From: Jeff Evans <email@hidden>
References: 
 >Using an anchor in NSURL file url (From: Jeff Evans <email@hidden>)

  • Prev by Date: Using an anchor in NSURL file url
  • Next by Date: Re: Using an anchor in NSURL file url
  • Previous by thread: Using an anchor in NSURL file url
  • Next by thread: Re: Using an anchor in NSURL file url
  • Index(es):
    • Date
    • Thread