NSURL URLWithString:relativeToURL: is clipping relative url
问题 I'm trying to implement an iOS app, which uses RestKit. In all examples I've seen so far the following code is used to create the URLs: NSURL *baseURL = [NSURL URLWithString:@"https://api.service.com/v1"]; NSURL *relativeURL = [NSURL URLWithString:@"/files/search" relativeToURL:baseURL]; But then [relativeURL absoluteString] will return https://api.service.com/files/search . So I tried a few examples: NSURL *baseURL1 = [NSURL URLWithString:@"https://api.service.com/v1/"]; NSURL *baseURL2 =