title: Encode UIImage to base64 string on iOS
body: <p>I have a problem with encoding UIImage to the base64 string using <a href="http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html" rel="nofollow">this category</a>.</p>
  
  <p>This is the code:</p>
  
  <pre><code>NSData *imageData = UIImageJPEGRepresentation([UIImage imageNamed:@"myImage.png"], 1.0);
  NSString *imageString = [imageData base64EncodedString];
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>-[NSConcreteData base64EncodedString]: unrecognized selector sent to instance 0x906800
    <em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteData
    base64EncodedString]: unrecognized selector sent to instance 0x906800'</p>
  </blockquote>
  
  <p>I just cannot figure it out where the problem is? Can anyone help me with this?</p>
  
  <p>Thanks!</p>
  
  <p><br />
  <strong>UPDATE</strong></p>
  
  <p>I just figured it out. Xcode did not put .m file into Compile Sources und project Build Phases. Why is this happening all the time on Xcode 4.3 ?</p>