Passing arguments to @selector method

后端 未结 2 1697
予麋鹿
予麋鹿 2020-12-11 13:58

I have added a UIButton in a table view. Now when I click a particular button, I need to get the details of the object corresponding to that row.



        
2条回答
  •  萌比男神i
    2020-12-11 14:21

    No not really. The click event is

    -(IBAction) fnc:(id)sender;
    

    If you want to call another method you will need to do so in a function of that form.

    -(IBAction) fnc:(id) sender
    {
       UIButton *b = (UIButton*) sender;
       [self otherFnc:b arg:arg1 arg2:arg2];
    }
    

提交回复
热议问题