I was adding some basic networking code to a simple case test and decided to 
try out NSURL URLWithString: relativeToURL:

As can be seen in the output below, it attempts to be doing the opposite of 
what is expected.  All I am trying to do is append a string to an NSURL and get 
back an NSURL.   

Am I making some monumentally obvious mistake in the code below? Because I 
can’t see it.

FYI, Xcode 10.1, iOS 12.1


self.loginURL = [NSURL URLWithString:@"/login" 
relativeToURL:self.sharedData.webServicesURL]; // // WHY does this not work? It 
does "/login -- https://qa-home.mrcooper.com/api";
 
 
(lldb) po self.sharedData.webServicesURL
https://qa-home.mrcooper.com/api
 
(lldb) po  [NSURL URLWithString:@"/login" 
relativeToURL:self.sharedData.webServicesURL]
/login -- https://qa-home.mrcooper.com/api
 
(lldb) po self.sharedData.webServicesURL.absoluteString
https://qa-home.mrcooper.com/api
 
 
 

Sent from my iPad
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to