I have NSURL forms
"http://abc.def.com:1234/stuff/"
and I want to add to it so that the final url is as follows
"http://abc.def.com:1234/stuff/?x=123".
But if I do it
url = [NSURL URLWithString:@"http://abc.def.com:1234/stuff/?"];
url = [url URLByAppendingPathComponent:@"x=123"];
Then the result
http:
(this is the same result if URLByAppendingPathExtension is used).
But if I do it
url = [NSURL URLWithString:@"http://abc.def.com:1234/stuff/?"];
url = [url URLByAppendingPathComponent:@"x=123"];
Then the result
http://abc.def.com:1234/stuff/%3Fx=123
(also the same result if URLByAppendingPathExtension is used).
None of them are what I do. How to get the final result "http://abc.def.com:1234/stuff/?x=123"?
source
share