Re: WTF? How can this work?
Re: WTF? How can this work?
- Subject: Re: WTF? How can this work?
- From: Chris Gehlker <email@hidden>
- Date: Sat, 18 Aug 2001 22:18:11 -0700
On 8/18/01 8:30 PM, "Mike Beam" <email@hidden> wrote:
>
Again, maybe I'm *completely* missing something fundamental here, but I
>
though NSArrays were _immutable_. It seems like this one here is behaving
>
exactly like an NSMutableArray. Is this behavior correct? Did the compiler
>
notice me trying to send addObject to an NSArray and decide that I really
>
wanted array to be typed NSMutableArray? Any help would be appreciated.
>
Thanks!
I'm fairly new to Cocoa but I have already learned that when you mess with
class clusters undocumented behavior is, well ... Undocumented. Maybe there
really is no such thing as an immutable array of strings. It's easy to
envision such an optimization. Remember that there aren't any actual
implementations of NSArray or NSMutableArray. The actual implementations are
members of private classes we know little about.
--
Laws are the spider's webs which, if anything small falls into them they
ensnare it, but large things break through and escape. -Solon, statesman
(c. 638-c558 BCE)