title: Objective-c iPhone percent encode a string?
body: <p>I would like to get the percent encoded string for these specific letters, how to do that in objective-c?</p>
  
  <pre><code>Reserved characters after percent-encoding
  !   *   '   (   )   ;   :   @   &amp;   =   +   $   ,   /   ?   #   [   ]
  %21 %2A %27 %28 %29 %3B %3A %40 %26 %3D %2B %24 %2C %2F %3F %23 %5B %5D
  </code></pre>
  
  <p><a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="noreferrer">Percent-encoding wiki</a></p>
  
  <p>Please test with this string and see if it do work:</p>
  
  <pre><code>myURL = @"someurl/somecontent"
  </code></pre>
  
  <p>I would like the string to look like:</p>
  
  <pre><code>myEncodedURL = @"someurl%2Fsomecontent"
  </code></pre>
  
  <p>I tried with the <code>stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding</code> already but it does not work, the result is still the same as the original string. Please advice.</p>