title: NSURL analog to CFURLCreateCopyAppendingPathComponent?
body: <p>Playing with URLs, more specifically building them incrementally from other, discovered URLs.  In doing so, I'd like to stay using NSURL objects instead of manipulating NSStrings, just to gain the added sanity checks and url-specific methods from the URL class.</p>
  
  <p>Unfortunately, it seems that there is no way to get the following to join together how I wish:</p>
  
  <pre>
  NSURL *base = [NSURL URLWithString:@"http://my.url/path"];
  NSString *suffix = @"sub/path";
  </pre>
  
  <p>I want to append them to get: <pre><a href="http://my.url/path/sub/path" rel="nofollow noreferrer">http://my.url/path/sub/path</a></pre></p>
  
  <p>But the best I can seem to get is:</p>
  
  <pre>
  NSURL *final = [NSURL URLWithString:suffix relativeToURL:base];
  </pre>
  
  <p>Which trims off the path on the base, resulting in: <pre><a href="http://my.url/sub/path" rel="nofollow noreferrer">http://my.url/sub/path</a></pre></p>
  
  <p>There's a CoreFoundation function that does it: </p>
  
  <pre>
  CFURLRef CFURLCreateCopyAppendingPathComponent (
     CFAllocatorRef allocator,
     CFURLRef url,
     CFStringRef pathComponent,
     Boolean isDirectory
  );
  </pre>
  
  <p>Which seems to work fine, but bouncing back/forth from ObjC to C is jarring and annoying...  I'd rather just manipulate strings...  Am I missing something?  Other than being way too picky of course. :)</p>