• 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
Re: NSData weirdness... another victim of dubious documentation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData weirdness... another victim of dubious documentation?


  • Subject: Re: NSData weirdness... another victim of dubious documentation?
  • From: Kirk Kerekes <email@hidden>
  • Date: Fri, 21 Jun 2002 12:06:43 -0500

On Friday, June 21, 2002, at 12:05 AM, email@hidden wrote:

But, because "data" is not a copy, just a pointer into the
same bytes that are held in "contents", it keeps going merrily on its
way, until it gets to the end of "contents".

From the Apple docs on the topic:

---------------------------------------------------------------------------
subdataWithRange:

- (NSData *)subdataWithRange:(NSRange)range

Returns a data object containing a copy of the receiver's bytes that fall within the limits specified by
----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
range. If range isn't within the receiver's range of bytes, an NSRangeException is raised.
----------------------------------------------------------------------------

"Containing a copy" is not good shorthand for "containing either a copy (if receiver is mutable subclass) or a reference to (if receiver is immutable)
"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: My newbie question..
  • Next by Date: Re: My newbie question..
  • Previous by thread: Re: NSTree ??
  • Next by thread: Creating temporary files?
  • Index(es):
    • Date
    • Thread