Re: Turn off duplicate method warning
Re: Turn off duplicate method warning
- Subject: Re: Turn off duplicate method warning
- From: Mike Blaguszewski <email@hidden>
- Date: Fri, 21 Jul 2006 17:22:25 -0400
On Jul 21, 2006, at 4:51 PM, Trygve Inda wrote:
-(QTMovie *)generate:(NSMutableDictionary *)dict is invoked as:
QTMovie = [[pluginInstances objectAtIndex:0] generate:dict]
So [pluginInstances objectAtIndex:0] is an instance of a class that
conforms
to my protocol (in which generate returns a QTMovie).
I don't know how to cast [pluginInstances objectAtIndex:0] since I
can't do
it to a specific class - only to a protocol since many classes can/
will
conform to the protocol.
If your protocol is named, say TPPlugin, then you can declare an
variable of type
id <TPPlugin> plugin;
Assigning to such a variable, or directly casting to id <TPPlugin>,
ought to give the compiler the info it needs, though I haven't tested
it.
--
Mike Blaguszewski / Cocoa Hacker / Ambrosia Software, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden