Re: confused about floats
Re: confused about floats
- Subject: Re: confused about floats
- From: Kyle Sluder <email@hidden>
- Date: Sat, 9 Oct 2010 11:33:04 -0700
On Sat, Oct 9, 2010 at 10:38 AM, Ariel Feinerman <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden