• 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: Selector not working for me
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selector not working for me


  • Subject: Re: Selector not working for me
  • From: Seth Willits <email@hidden>
  • Date: Sun, 1 May 2005 23:16:43 -0700
  • Resent-date: Sun, 1 May 2005 23:17:01 -0700
  • Resent-from: Seth Willits <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: Cocoa-Dev Dev <email@hidden>

On May 1, 2005, at 5:55 AM, John James wrote:

-(void)test1
{NSLog(@"test1");}

-(void)test2:(NSString*)val
{NSLog(val);}

@end
-------------------

Elsewhere At runtime I try the following

    if ([Seltest respondsToSelector: @selector(test1:)]==YES)
        NSLog(@"YES");
    else
        NSLog(@"NO");

I always get NO!
Shouldn't it be YES?

Nope. See the ":" after test1? That shouldn't be there. Having a trailing ":" indicates that there is a parameter there, but as you can see with your actual method, there isn't one. 


So you should be doing this:

   if ([Seltest respondsToSelector: @selector(test1)]==YES)





Seth Willits
----------------------------------------------------------
Freak Software - http://www.freaksw.com/
ResExcellence - http://www.resexcellence.com/realbasic/
----------------------------------------------------------

 _______________________________________________
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

  • Prev by Date: Re: Selector not working for me
  • Next by Date: Re: Selector not working for me
  • Previous by thread: Re: Selector not working for me
  • Next by thread: Re: Selector not working for me
  • Index(es):
    • Date
    • Thread