Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send selector to another class

How do I send a selector to another class? I want to send a selector from a subview to the main view to push the next view controller.

like image 710
MaikelS Avatar asked May 20 '26 14:05

MaikelS


1 Answers

SEL selectorToSend = @selector(mySuperDuperMessage:);
[otherClass iWantASelector:selectorToSend];

otherClass:

@interface{
SEL aSelector;
}

@implementation{
-(void) iWantASelector:(SEL) newSelector
{
    aSelector = newSelector;
}
like image 134
James Webster Avatar answered May 22 '26 03:05

James Webster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!