Is the NSData used to create a NSImage copied or retained?
Is the NSData used to create a NSImage copied or retained?
- Subject: Is the NSData used to create a NSImage copied or retained?
- From: Development <email@hidden>
- Date: Thu, 29 Jan 2009 20:33:54 -0500
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 (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