• 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
URLWithString:relativeToURL:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

URLWithString:relativeToURL:


  • Subject: URLWithString:relativeToURL:
  • From: James Longstreet <email@hidden>
  • Date: Sat, 14 Jan 2006 13:10:10 -0600

Hi, folks,

I want a URL of the form "http://example.com/path/to/file?url=http:// otherexample.com/file". The base part of the URL (http:// example.com) is stored in an NSURL instance variable, call it baseURL. The other URL (http://otherexample.com/file) is passed as an argument to the method, call it otherURL, and the /path/to/file? url= part is constant.

NSString *temp = [@"/path/to/file?url=" stringByAppendingString:
						[otherURL absoluteString];
NSURL *final = [NSURL URLWithString:temp relativeToURL:baseURL];
...

When I break after that second line, final has the value "/path/to/ file?url=http://otherexample.com/file";.

I tried using stringByAppendingPercentEscapesUsingEncoding as well, but got the same results.
_______________________________________________
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
  • Prev by Date: Re: Getting started with WebKit plugins
  • Next by Date: Re: Silencing beeps from nonexistent key equivalents
  • Previous by thread: Re: NSURLProtocol and custom URL scheme
  • Next by thread: Image loading design suggestions ?
  • Index(es):
    • Date
    • Thread