- (void) hitHere: (NSInteger) number indexPath: (NSString *) str {
NSLog (@ "message printed: number% d, contents% @", number, str);
}
There is this line of code in another method:
UITapGestureRecognizer * singleTouch = [[UITapGestureRecognizer alloc] initWithTarget: self action: @ selector (hitHere: indexPath :)];
In this case @ selector (hitHere: indexPath :) does not pass parameters that way? ? ? ?
That these two parameters that how to pass it? ? ? ? Solving
Reply:
Functions like @ selecttor pass (id) sender parameter, multi-parameter you should then define a method, and then call your - (void) hitHere: (NSInteger) number indexPath: (NSString *) str {
For instance, your method is called - (void) buttonDone: (id) sender
{
[Self hitHere: (NSInteger) number indexPath: (NSString *) str]; assignment parameters on it.
}
I hope to be able to help you.
Reply:
The method can be written
- (Void) hitHere: (UIGestureRecognizer *) gesture {
MyCell * cell = (MyCell *) [gesture view];
NSLog (@ "message printed: number% d, contents% @", cell.number, cell.titleContent);
}
Reply:
Only one parameter is passed, thank you
Reply:
Do the same way as if you are first down, and there is time to use, thank you
Reply:
This can do it. Ask to see more and more thinking. Oh
No comments:
Post a Comment