title: NSString's stringByAppendingPathComponent: removes a '/' in http://
body: <p>I've been modifying some code to work between Mac OS X and iPhone OS.</p>
  
  <p>I came across some code that was using <code>NSURL</code>'s <code>URLByAppendingPathComponent:</code> (added in 10.6), which as some may know, isn't available in the iPhone SDK.</p>
  
  <p>My solution to make this code work between OS's is to use</p>
  
  <pre><code>NSString *urlString = [myURL absoluteString];
  urlString = [urlString stringByAppendingPathComponent:@"helloworld"];
  myURL = [NSURL urlWithString:urlString];
  </code></pre>
  
  <p>The problem with this is that <code>NSString</code>'s <code>stringByAppendingPathComponent:</code> seems to remove one of the /'s from the http:// part of the URL.</p>
  
  <p>Is this intended behaviour or a bug?</p>
  
  <hr>
  
  <h2>Edit</h2>
  
  <p>Ok, So I was a bit too quick in asking the question above. I re-read the documentation and it <strong>does</strong> say: </p>
  
  <blockquote>
    <p>Note that this method only works with file paths (not, for example, string representations of URLs)</p>
  </blockquote>
  
  <p>However, it doesn't give any pointers in the right direction for what to do if you need to append a path component to a URL on the iPhone...</p>
  
  <p>I could always just do it manually, adding a /if necessary and the extra string, but I was looking to keep it as close to the original Mac OS X code as possible...</p>