Re: Mutability
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!