• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is the NSData used to create a NSImage copied or retained?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: NSOpenPanel - disabling the "Open" button for certain folders.
  • Next by Date: Re: Interface Builder Plugin Dependency
  • Previous by thread: NSOpenPanel - disabling the "Open" button for certain folders.
  • Next by thread: Sizing table columns to fit data - a solution looking for suggestions
  • Index(es):
    • Date
    • Thread