How to pass a variable to a UIButton action

前端 未结 8 1555
南笙
南笙 2020-12-13 21:05

I want to pass a variable to a UIButton action, for example

NSString *string=@\"one\";
[downbutton addTarget:self action:@selector(action1:string)
     forCo         


        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 21:18

    The only way I've found to do this is set an instance variable before calling the action

提交回复
热议问题