title: 'unrecognized selector sent to instance'?
body: <p>I'm new to Objective C and having trouble understanding why I am getting this error. I've checked other similar questions, but haven't been able to resolve the issue.</p>
  
  <p>The error is "-[NSConcreteMutableData base64Decoded]: unrecognized selector sent to instance 0x6e15610"</p>
  
  <p>Here is a snippet of the problem code, where the call to base64Decoded is causing the crash.</p>
  
  <pre><code>#import "DDData.h"
  
  - (NSString *)decodeBase64:(NSString *)input
  {
      NSData* dataDecoded = [[input dataUsingEncoding:NSUTF8StringEncoding] base64Decoded];    
      return [NSString stringWithUTF8String:[dataDecoded bytes]];
  }
  </code></pre>
  
  <p>And in DDData.h:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface NSData (DDData)
  
  - (NSData *)base64Decoded;
  
  @end
  </code></pre>
  
  <p>and DDData.m:</p>
  
  <pre><code>@implementation NSData (DDData)
  
  - (NSData *)base64Decoded
  {
       // Excluding function code, as it never gets to here
  }
  
  @end
  </code></pre>
  
  <p>Just a note that the Project has ARC enabled. Any ideas as to what might be the issue here? Thanks.</p>
  
  <p>EDIT: I have adjusted the above code to help debug the error:</p>
  
  <pre><code> NSData* dataDecoded = [input dataUsingEncoding:NSUTF8StringEncoding];
  [dataDecoded base64Decoded];
  </code></pre>
  
  <p>dataDecoded gets a value from dataUsingEncoding, it is not nil when the call to base64Decoded is made. When I step over to the called to base64Decoded, it crashes.</p>