URLWithString:relativeToURL:
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