Re: NSImage & memory
Re: NSImage & memory
- Subject: Re: NSImage & memory
- From: Jeremy Rotsztain <email@hidden>
- Date: Tue, 17 Jul 2007 13:50:11 -0400
gotcha. that makes sense, i'm not taking ownership of the object, so
i don't need to release it.
thanks for the quick responses.
On Jul 17, 2007, at 1:41 PM, Uli Kusterer wrote:
On 17.07.2007, at 19:20, Jeremy Rotsztain wrote:
// generate the image
tmpImg = [[ NSImage alloc] initWithSize:imgNewSize ]];
General rule: Send us the code you actually compiled, just in case
you have a typo that you're overlooking (e.g. a comma instead of a
semicolon can be devilishly hard to track down). The line above
should not even compile.
// write image to disk
NSData *tmpImgTIFFData = [ tmpImg TIFFRepresentation ];
Does it say "copy", "retain" or "init" anywhere in that call? No?
So it's an object owned by someone else, but not you. Probably some
Autorelease Pool or tmpImg own this NSData.
[ tmpImgTIFFData writeToFile:@"/Users/kiev/Desktop/
FlickrComposition.tiff" atomically:YES ];
// release data
[ tmpImgTIFFData release ];
What are you doing releasing an object owned by someone else?
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden