On Mar 19, 2012, at 5:51 AM, Ian Joyner wrote: > Actually NSArray. Note NSMutableArray inherits from NSArray because it adds > extra functionality in methods that can change the object. You can assign an > NSMutableArray object to an NSArray reference, thereby making it unchangeable > via that path, but you can't assign an NSArray object to an NSMutableArray.
Declaring an NSMutableArray as an NSArray doesn't make it immutable, because you can still send NSMutableArray messages to the array and they'll still work (though the compiler will complain unless you mask them or send the message indirectly). The only way to make a mutable array immutable is to make an immutable copy of the array. Nick Zitzmann <http://www.chronosnet.com/> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com