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

Re: Mutability


  • Subject: Re: Mutability
  • From: Andrew Pinski <email@hidden>
  • Date: Thu, 22 Nov 2001 14:24:26 -0500

What about mutable=[array respondsToSelector:@selector(addObject:)]; ?
Then you don't have to worry about customs classes, that someone might send to you.
This is not really that hackish.

Thanks,
Andrew Pinski


On Thursday, November 22, 2001, at 01:58 , Ondra Cada wrote:

Erik,

Erik M. Buck (EMB) wrote at Wed, 21 Nov 2001 17:05:44 -0600:
EMB> If an object is advertised as immutable then that immutability should be
EMB> respected even if the object is actually mutable.

That's right, but what has it to do with the fact that if the object is
*NOT* advertised as anything but an object -- ie. id, the basic ObjC type! --
then there seems to be no (decent*) way to get its real class in runtime.
That's a bug.

(*) The trick of mutable=YES; NS_DURING [array addObject:@""]; [array
deleteLastObject]; NS_HANDLER mutable=NO; NS_ENDHANDLER is nice, but too much
on the hackish side to be treated as a decent solution!


  • Follow-Ups:
    • Re: Mutability
      • From: Ondra Cada <email@hidden>
    • Re: Mutability
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: Mutability (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: automatic spell checking
  • Next by Date: Re: automatic spell checking
  • Previous by thread: Re: Mutability
  • Next by thread: Re: Mutability
  • Index(es):
    • Date
    • Thread