On Sat, Oct 9, 2010 at 10:38 AM, Ariel Feinerman <arielfap...@gmail.com> wrote:
>       NSObject *kit;
>>        kit = [[kits selectedObjects] objectAtIndex:0];
>>
>
> // it is more convenience
> id <NSObject> kit;

Why would you do this? It is not more convenient. It is actually a
hell of a lot less convenient, because now the compiler will warn you
about every non-NSObject method you send to kit, even though you might
know that kit responds to it. This includes all system-defined methods
on NSObject-the-class that aren't part of NSObject-the-protocol, like
-valueForKey:.

In fact, I can't think of a situation when it *ever* makes sense to
type something as id <NSObject> rather than NSObject.

--Kyle Sluder
_______________________________________________

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