title: Functionality of sprintf for NSString
body: <p>How can I get the functionality of <a href="http://en.wikibooks.org/wiki/A_Little_C_Primer/The_C_sprintf_Function" rel="nofollow"><code>sprintf</code></a> in Objective-C? The function is of course part of <code>stdio</code> in C, so I could certainly invoke it, but since I'm using Foundation, I need it to work with <code>NSString</code>s as well.</p>
  
  <h2>EDIT</h2>
  
  <p>I apologize for my inarticulateness, but I'm actually hoping for something more like the <a href="http://php.net/manual/en/function.sprintf.php" rel="nofollow">PHP <code>sprintf</code> <strong>function</strong></a> that returns a string. (This was perhaps slightly evident before Josh Caswell's very efficient edit of my question.) It would be like <code>NSLog</code> but instead of writing to console would give a string (or pointer) as a return value.</p>