Re: NSData weirdness... another victim of dubious documentation?
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.