I added a gesture to a label and when tapped i would like to trigger showlbl that will take int as an argument, however I\'m getting a compiler error for:
UITapG
It doesn't work that way. You can only specify the name of the selector, i.e. the name of the method that is to be called. The form of the selector (the number of arguments) is fixed and defined by the class that calls your action method (in this case, UITapGestureRecognizer
).
For this particular action method, the one and only argument to the action method will be an object of type UIGestureRecognizer *
). If you the method to have access to another variable, you have to declare an appropriate ivar/property and store the value there.