title: Trying to understand memory management on the iOS platform
body: <p>Here's a block of code that has leaks...</p>
  
  <pre><code>NSString *filename = [NSString stringWithFormat:@"%@.png", sketchID];
  CGImageRef imageRef = CGBitmapContextCreateImage(paintView.canvas.mBitmapContext);
  UIImage* image = [[UIImage alloc] initWithCGImage:imageRef];
  NSData* imageData = UIImagePNGRepresentation(image); 
  </code></pre>
  
  <ol>
  <li>Where are they?</li>
  <li>In general, how can I tell so I don't create leaks in the future?</li>
  <li>What's the proper way to fix them?</li>
  </ol>
  
  <p>Thanks so much!</p>