• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Turn off duplicate method warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Turn off duplicate method warning (From: Trygve Inda <email@hidden>)

  • Prev by Date: Exception in NSTreeController:removeObjectAtArrangedObjectIndexPath
  • Next by Date: ODBC
  • Previous by thread: Re: Turn off duplicate method warning
  • Next by thread: Re: Turn off duplicate method warning
  • Index(es):
    • Date
    • Thread