Skip navigation.
 
mlRe: Turn off duplicate method warning
FROM : Mike Blaguszewski
DATE : Fri Jul 21 23:22:25 2006

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.

Related mailsAuthorDate
mlTurn off duplicate method warning Trygve Inda Jul 21, 14:09
mlRe: Turn off duplicate method warning Rob Ross Jul 21, 16:38
mlRe: Turn off duplicate method warning Trygve Inda Jul 21, 22:51
mlRe: Turn off duplicate method warning Mike Blaguszewski Jul 21, 23:22
mlRe: Turn off duplicate method warning Uli Kusterer Jul 22, 19:46