On Oct 9, 2010, at 3:12 PM, Ariel Feinerman wrote:

> 2010/10/9 Kyle Sluder <kyle.slu...@gmail.com>
> 
>> 
>> 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 (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/velocityboy%40rodentia.net
> 
> This email sent to velocity...@rodentia.net

_______________________________________________

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