On Nov 18, 2009, at 11:15 AM, Jim Correia wrote:

> On Nov 18, 2009, at 1:49 PM, Jens Alfke wrote:
> 
>> This is unfortunately true. The danger is that if you add an _-prefixed 
>> method to your class, it might conflict with a private method declared in a 
>> superclass. If this happens your method will override the internal one, and 
>> Really Bad Things will probably happen. It's a rare problem but it has 
>> happened before. (And even if everything works well now, any future OS 
>> update might add a new private method in a superclass that breaks your code. 
>> Again, this has actually happened.)
> 
> This problem is just not restricted to private methods, or additions through 
> categories. You can also run afoul of a namespace conflict with a public 
> method in your subclass.
> 
> Suppose you have a subclass of NSView which adds 
> -reallyNiceMethodThatOughtToBeInAppKit. If Apple adds such a method in the 
> next OS release, the same kinds of problem can result. (Similar problems when 
> you extend delegate protocols for your subclasses too.)
> 
> This problem is much less insidious than the category problem, but the 
> potential does exist. (For both private and public methods.)
> 
> - Jim
> 
> 

Thanks to all who answered for you insights.

_______________________________________________

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

Reply via email to