On Dec 8, 2008, at 5:15 PM, Adam Leonard wrote:
But using NSDictionary as a placeholder for something that actually
happens to be mutable seems fine to me if you don't want to have
clients relying on the method's implementation using a mutable
dictionary internally.
I'm pretty sure I have seen the Cocoa frameworks doing this.
Yup. I just did a quick test using -[NSView subviews]. The return
type is NSArray*, but if you send -addSubview: to the view, the size
of the previously returned array grows by 1.
I would never assume a returned array is immutable just because the
declared return type of a method is NSArray*.
--Andy
_______________________________________________
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 [EMAIL PROTECTED]