On Fri, Mar 25, 2011 at 1:30 AM, Louis Gerbarg <lgerb...@gmail.com> wrote: > The corner case you mention below ( [myMutableArrayInstance > isKindOfClass:[NSMutableArray class]] ) is a nonissue for a somewhat > surprising reason. All instances of NSArray are actually implemented via the > concrete class NSCFArray, which is a subclass of NSMutableArray. Thus any > instances of mutable or immutable arrays return YES to isKindOfClass for both > NSArray and NSMutableArray. The only time that is not true is when people > implement custom subclasses of NSArray. Thus no one can depend on that > particular construct working unless they have implemented their own > subclasses. > > For that reason, you can probably completely ignore the issue.
I agree. When bridging Perl's array & hashes, I didn't even bother creating an immutable class. A mutable array can be passed to any method that expects an array, and such a method is more or less obligated by practical concerns to treat it as the declared type. sherm-- sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com