Re: Mutable class problems
Re: Mutable class problems
- Subject: Re: Mutable class problems
- From: Cameron Hayne <email@hidden>
- Date: Wed, 26 Jun 2002 16:09:09 -0400
On Wednesday, June 26, 2002, at 12:14 pm, Andy Lee wrote:
True, the Foundation names don't carry the false implication -- as long
as you ignore the documentation. In reality, an NSArray -- an object
legitimately pointed to by an NSArray * -- may or may not be mutable.
In the documentation, "An NSArray stores an immutable array of objects."
As a newbie, I was confused by this issue. (But for me, it was the case
of NSData vs NSMutableData.)
It would be better if the documentation said something like: "NSArray
provides read-only access to an array of objects supplied at creation
time." The documentation should go on to say something like: "Subclasses
of NSArray may extend access to allow read-write semantics so
programmers should not assume that an NSArray object is necessarily
immutable. See, for example: NSMutableArray."
As a general note on the documentation, I would have liked to see each
class mention ("see also") all known subclasses - this is what is done
in Sun's Java documentation and it is very useful.
... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.