Re: Selector not working for me
Re: Selector not working for me
- Subject: Re: Selector not working for me
- From: Stefan Jung <email@hidden>
- Date: Mon, 2 May 2005 09:18:51 +0200
Your method name is test1 without colon, but you test for test1: with colon.
Remove the colon in your if close or change it to test2: should work.
Stefan Jung
Am 01.05.2005 um 14:55 schrieb John James:
I am probably doing some stupid newbie thing; please help.
i have a simple test case to try the selector feature. given the following class definition and implementation:
--------------
#import <Cocoa/Cocoa.h>
@interface Seltest : NSObject
{}
-(void)test1;
-(void)test2:(NSString*)val;
@end
-----------
#import "seltest.h"
@implementation Seltest
-(void)test1
{NSLog(@"test1");}
-(void)test2:(NSString*)val
{NSLog(val);}
@end
-------------------
Elsewhere At runtime I try the following
if ([Seltest respondsToSelector: YES)
NSLog(@"YES");
else
NSLog(@"NO");
I always get NO!
Shouldn't it be YES?
Thanks for your help _______________________________________________
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
_______________________________________________
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