On Apr 1, 2010, at 7:42 PM, Greg Parker wrote:

> On Apr 1, 2010, at 10:32 AM, Andreas Grosam wrote:
> It would be possible to declare a new NSThreadPerformingObject protocol that 
> built upon the NSObject protocol. You could do this yourself if you like. But 
> even that would only work for one Mac OS X version, because older OS versions 
> had fewer thread perform methods and newer OS versions will likely add more.
Hence, I mentioned that I assume the framework is "more or less stable". But 
this is a possibly problem for any interface, including those from categories.

> 
> In practice, what you really want is an instance that does everything class 
> NSObject does, plus the delegate methods. The best way to write that is:
>   NSObject<SomeProtocol> *obj;

Ah yes, this will solve the compiler warning! Since in this case, the 
interfaces of categories will be implicitly added. In fact, I can declare my 
delegates like this.

Still, I see an advantage when using protocols. The argument of changing 
interfaces does not count IMO, since Categories are prone to changes as well. 
If sometimes the category get removed or the methods get changed, my code will 
not run anymore ;) 
I don't think this will happen, though.

Thanks for replying and the hint!

Andreas


> 
> 
> -- 
> Greg Parker     gpar...@apple.com     Runtime Wrangler
> 
> 

_______________________________________________

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