Re: Multiple declarations and the ID type
Re: Multiple declarations and the ID type
- Subject: Re: Multiple declarations and the ID type
- From: Sherm Pendley <email@hidden>
- Date: Mon, 21 Jun 2004 21:30:29 -0400
On Jun 21, 2004, at 2:02 PM, Jamie wrote:
Cast to the protocol? I didn't know you could do that. Is that
really the only way this can be solved?
Just declare the variable as an id that conforms to MyProtocol, like
this:
@interface SomeClass {
id<MyProtocol> someObject;
}
@end
I don't know what Alberto meant by "cast to that before calling the
method" - if the variable is correctly declared, there should be no
need for a type cast when its methods are called.
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.