• 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: Trygve Inda <email@hidden>
  • Date: Fri, 21 Jul 2006 20:51:19 +0000
  • Thread-topic: Turn off duplicate method warning

> On Jul 21, 2006, at 5:09 AM, Trygve Inda wrote:
>> I have two methods:
>>
>> -(void)generate:(NSMutableDictionary *)dict
>>
>> This is in my main AppController (and in AppController.h), and it
>> calls
>>
>> -(QTMovie *)generate:(NSMutableDictionary *)dict
>>
>> which is in a different class that is loaded in a plug in. This one is
>> defined in a protocol file (which the AppController has to import).
>> I get a
>> "duplicate method" warning. How can I get rid of this?
>>
>> As the methods are in different classes, it should be fine (and the
>> code
>> works without problem).
>>
>> Thanks,
>>
>> Trygve
>
> I'm remembering something from class, and my memory tells me
> something about selectors being globally scoped. I.e., there's just
> one table that holds all the selectors, and I think the return type
> is not a sufficient discriminator. The second method would fail as an
> attempted method override, so maybe that's why you're getting the
> warning.

The first one is an action from a button:

-(IBAction)generate:(NSMutableDictionary *)dict // not void as above

> How do you invoke the second message call (what is the type of the
> reference you are using?) Is it an 'id'? If so, you might try casting
> it to the reference type of the actual Class or Protocol of the
> object instance.

-(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.

> Keep in mind I have just as much experience in Cocoa as you do, so
> maybe I'm the blind man trying to lead ;)

All blind here!


 _______________________________________________
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

  • Follow-Ups:
    • Re: Turn off duplicate method warning
      • From: Mike Blaguszewski <email@hidden>
References: 
 >Re: Turn off duplicate method warning (From: Rob Ross <email@hidden>)

  • Prev by Date: NSDistantObject for Machine to Machine DO
  • Next by Date: Re: KVO and the observeValueForKeyPath bottleneck
  • Previous by thread: Re: Turn off duplicate method warning
  • Next by thread: Re: Turn off duplicate method warning
  • Index(es):
    • Date
    • Thread