• 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: Mutable class problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • class docs (was: Re: Mutable class problems)
      • From: Andy Lee <email@hidden>
References: 
 >Re: Mutable class problems (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: NSURL Bug?
  • Next by Date: Why use PreferencePanes.framework?
  • Previous by thread: Re: Mutable class problems
  • Next by thread: class docs (was: Re: Mutable class problems)
  • Index(es):
    • Date
    • Thread