title: How to concat a const char * to a NSString *
body: <p>Trying to append <code>const char *str</code> to a <code>NSSting *</code>:</p>
  
  <p>In .h</p>
  
  <pre><code>@interface SomeViewController : UIViewController
  {
      NSString    *consoleText;
  }
  
  @property (nonatomic, retain) NSString *consoleText;
  
  @end
  </code></pre>
  
  <p>In .mm </p>
  
  <pre><code>@synthesize consoleText;
  </code></pre>
  
  <p>The following is OK:</p>
  
  <pre><code>const char *str = "abc";
  
  self.consoleText = [NSString stringWithFormat: @"%@%@", self.consoleText, [NSString stringWithUTF8String:str]];
  </code></pre>
  
  <p>but the following failed:</p>
  
  <pre><code>self.consoleText = [self.consoleText stringByAppendingString:[NSString stringWithUTF8String:str]];
  </code></pre>
  
  <p>Why <code>stringByAppendingString</code> fails but <code>stringWithFormat</code> works? Thanks!</p>