If I have a function that is defined in class Foo, and my class Bar has a reference to class Foo, can I use the @selector to call that function? Something like
@selector([Foo someFunctionInFoo:])
I have only used the @selector to call functions in the same class. I tried doing something similar to the above code, but it didn’t work and I wasn’t sure if it was even possible. Thanks.
@selectordoesn’t store any calls information, just the selector.You can also do:
As long as both implement
someFunction.To specify which target is used by buttons etc you set the target and the action as two properties, e.g.: