Re: why isn't id<MyCellDelegate> an id?
Re: why isn't id<MyCellDelegate> an id?
- Subject: Re: why isn't id<MyCellDelegate> an id?
- From: Greg Parker <email@hidden>
- Date: Fri, 04 Oct 2013 12:50:03 -0700
On Oct 4, 2013, at 9:59 AM, Matt Neuburg <email@hidden> wrote:
> Surely an id<MyCellDelegate> is, by definition, an id
It is not. There is no id-style type system leniency in `id<SomeProtocol>`. That type must conform to the protocol and respond to its methods, and nothing more. Unlike `id` it does not allow use of any other methods.
In practice you'll usually want to use NSObject<SomeProtocol>*, in part because there are useful methods in class NSObject that are not part of protocol NSObject.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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