Re: Selector not working for me
Re: Selector not working for me
- Subject: Re: Selector not working for me
- From: Phil Larson <email@hidden>
- Date: Sun, 1 May 2005 23:03:07 -0700
On May 1, 2005, at 5:55 AM, John James wrote:
if ([Seltest respondsToSelector: @selector(test1:)]==YES)
NSLog(@"YES");
else
NSLog(@"NO");
I always get NO!
Shouldn't it be YES?
Thanks for your help
John,
You need to make an instance of Seltest first. It's testing if
there's a class method called "test1" right now
Example:
Seltest *testObj = [[Seltest alloc] init];
if ([testObj respondsToSelector: @selector(test1:)]==YES)
NSLog(@"YES");
else
NSLog(@"NO");
Sincerely,
Phil Larson
_______________________________________________
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