This is a simple question, that I can not find in the documentation.

When a programmer uses the NSImage's initWithData: method to create an image, the call is passed an NSData object. This is usually a data representation of a JPEG, GIF or other graphic file format (usually read from a file or downloaded from a URL).

Does this call make a copy of the data stored in the NSData object passed to it, or does the new NSImage retain that specific NSData object? The documentation says "Initializes and returns an NSImage instance with the contents of the specified NSData object." That could mean either way. I know there is an additional object (a NSImageRep is actually created), but does that object copy or retain the bytes stored in the NSData object?

I am working on some data caching schemes, so knowing what is being copied vs what is being retained is important.

Thank you...

Steve
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to