title: Converting NSImage to NSData
body: <p>I get NSImage like that:</p>
  
  <pre><code>imageG = [[[NSImage alloc] initWithSize:NSMakeSize(imageN.size.width, imageN.size.height)] autorelease];
  [imageG addRepresentation:[NSCIImageRep imageRepWithCIImage:result]];
  </code></pre>
  
  <p>And the result is really good. So there are no mistakes i think. And then I try to convert this image to NSData like that:</p>
  
  <pre><code> NSData *imgData = [imageG TIFFRepresentation];
  </code></pre>
  
  <p>And i am getting error:</p>
  
  <pre><code>Thread 1: EXC_BAD_ACCESS (code=13, adress=0x0)
  </code></pre>
  
  <p>at that line. Where is my mistake?</p>