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: John Stiles <email@hidden>
- Date: Wed, 21 Mar 2007 13:50:37 -0700
On Mar 21, 2007, at 12:26 PM, Phil Holland wrote:
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> *)
It sounds like a good documentation enhancement request to me—"please
show examples of using a protocol with a non-id type". You should
Radar it!
_______________________________________________
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