Just like the question said. Is possible to set global button(not in the class) to activate global method directly? I confused on setting target and action part.
import "Global.h"
void methodA()
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundRect];
button.frame = CGRectMake(0,441,100,30);
[button addTarget:??? action@selector(methodB????) forControlEvent...];
}
void methodB()
{
}
//end of file
What you are trying to do is set up a nil-targeted action that works with the Responder Chain.
Have a read about it in the iOS Core Competencies documentation.