I have tried and got “SIGBRT” exception.
In Global.m, I have methodBGlobal().
In ClassA, I included Global.h in order to use methodGlobal().
ClassA.methodA() has methodGlobal() in it.
Then I have button in Global.m. Since I do not know how to call methodGlobal() properly in Global.m. SO I call the methodGlobal() through ClassA instance.
[mybutton addTarget:ClassA instance action:@selector(methodA:) ...];
It does not work. I got “SIGBRT” exception and I do not know that methodGlobal() in ClassA.methodA() was called or not? I want methodGlobal to work.
Two things you need to consider here.
Finally the
addTarget:method should look like,References: