UITapGestureRecognizer *tap= [[ UITapGestureRecognizer alloc ] initWithTarget : self action : @selector (tap:)]; If @selector is used, the parameter seems to be fixed, and it can only be a single parameter. I tried to pass array or id type, or [Self add: add:] The result is that the program runs and it crashes directly. Fortunately, what I passed is section and tag. Then I use Brother Yong’s suggestion to combine the two into a set of NSstrings and split them at the other end. In the process, I discovered that the tag value is not allowed to start with 0. If it is, it is omitted by default. So using the effective string splicing method, the last question I think of is that when the demand exists, what we have to do is to change our way of thinking, not to restrict ourselves to open up our own thinking, the question is if the demand is What is passed is another string instead of a number, is it impossible to operate? Need to think!
About tap gesture transfer @selector
Recently I encountered a special requirement. After considering repeatedly I decided to use the click gesture to pass parameters. The problem lies in the initialization of the click.
Guess you like
Origin blog.csdn.net/u010436133/article/details/45463507
Recommended
Ranking