title: iPhone app crash when converting formatted NSString to UTF8 char *
body: <p>I want to convert a NSString into a const char * in order to access a sqlite DB.</p>
  
  <p>This works:</p>
  
  <pre><code>NSString *queryStatementNS = @"select title from article limit 10";
  const char *queryStatement = [queryStatementNS UTF8String];
  </code></pre>
  
  <p>This causes a crash in the simulator (without any stacktrace):</p>
  
  <pre><code>NSString *queryStatementNS = [NSString stringWithFormat:@"select title from article limit %d", 10];
  const char *queryStatement = [queryStatementNS UTF8String];
  </code></pre>
  
  <p>Can anybody tell me, what the stringWithFormat method changes in the String to make the conversion to UTF8 (or to ASCII using cStringUsingEncoding:NSASCIIStringEncoding) crash? The same crash happens also when passing no arg at all to the stringWithFormat. Could it be related to memory management somehow?</p>