Reputation: 27384
I have an XML callback selector that seems to fail at the respondsToSelector
test and I am not sure why. Why is the call failing?
The callback is set like so:
[handler setXMLCallBackDelegate:self :@selector(gotXMLCallback)];
The callback is defined like so (in calling class):
-(void)gotXMLCallback:(id)sender{
NSLog(@"CALLBACK YAY");
}
And the callback is called using this code (from within handler):
if (gotXMLCallback && gotXMLCallbackSelector && [gotXMLCallback respondsToSelector:gotXMLCallbackSelector]) {
(void) [gotXMLCallback performSelector:gotXMLCallbackSelector withObject:self];
}
Upvotes: 0
Views: 260
Reputation: 2207
To stablish a selector you should call it
[gotXMLCallback performSelector:@selector(gotXMLCallbackSelector:) withObject:self];
Upvotes: 0
Reputation: 53551
The colon is part of the selector, so it should be @selector(gotXMLCallback:)
.
Upvotes: 2