• 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
NSURL relativePath problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURL relativePath problem


  • Subject: NSURL relativePath problem
  • From: Koen van der Drift <email@hidden>
  • Date: Thu, 29 Aug 2013 14:02:09 -0400

I'm having some difficulties constructing a URL from a baseURL and a relativeURL when the relativeURL starts with a question mark:

    NSURL *baseURL = [NSURL URLWithString: @"http://www.test.com/test/";];
    NSString *relativeString = @"?query=test";

    NSURL *url = [NSURL URLWithString: relativeString relativeToURL: baseURL];

This results in the following url:

?query=test -- http://www.test.com/test/

While I want it to be:

http://www.test.com/test/?query=test


I can just generate the whole URL at once, but I was wondering why I get this behavior?


Thanks,

- Koen.








_______________________________________________

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: NSURL relativePath problem
      • From: Kyle Sluder <email@hidden>
    • Re: NSURL relativePath problem
      • From: Ken Thomases <email@hidden>
    • Re: NSURL relativePath problem
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: Creating CGFont from PDF Tf operator
  • Next by Date: Re: NSURL relativePath problem
  • Previous by thread: Re: validateUserInterfaceItem problem
  • Next by thread: Re: NSURL relativePath problem
  • Index(es):
    • Date
    • Thread