Re: Why does (id <MyProtocol>) have to be id?
Re: Why does (id <MyProtocol>) have to be id?
- Subject: Re: Why does (id <MyProtocol>) have to be id?
- From: Phil Holland <email@hidden>
- Date: Wed, 21 Mar 2007 12:26:35 -0700
On Mar 21, 2007, at 12:16 PM, Jerry Krinock wrote:
But all the examples of protocol names are of type id, like this:
(id <MyProtocol>)
And, indeed, a protocol in a non-'id' type declaration, like this:
(NSView* <MyProtocol>)
won't compile. Why not?
Because you need to declare that the class, not a pointer to it,
implements the protocol. What you're looking for is:
(NSView <MyProtocol> *)
--Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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