Re: confused about floats
Re: confused about floats
- Subject: Re: confused about floats
- From: Velocityboy <email@hidden>
- Date: Sat, 9 Oct 2010 15:25:21 -0700
On Oct 9, 2010, at 3:12 PM, Ariel Feinerman wrote:
> 2010/10/9 Kyle Sluder <email@hidden>
>
>>
>> In fact, I can't think of a situation when it *ever* makes sense to
>> type something as id <NSObject> rather than NSObject.
>>
>> Because you can wish to use your own root class, there is difference
> between these. I dont know, but maybe it is why the delegates is always has:
> id <Thing>, it is just my opinion.
These two constructs are not synonyms.
NSObject *foo; // foo is a pointer to an object of type NSObject
id<NSObject> foo; // foo is a pointer to an object of unspecified type which implements the protocol named NSObject
This is a bit confusing because there are both a protocol called NSObject which specifies the methods you need to implement if you're creating your own base class for all objects. NSObject the type implements NSObject the protocol and IS the default base class for all other objects.
The reason delegates are specified using the <> notation is that they are protocols, not classes; they specify the methods the delegate must or can usefully implement, but they do not provide an implementation for those methods.
>
>
>
> --
> best regards
> Ariel
> _______________________________________________
>
> 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
_______________________________________________
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