Objective C: Sending arguments to a method called by a UIButton

后端 未结 6 757
甜味超标
甜味超标 2021-01-06 10:26

I have a method that is being called when a UIButton is clicked. When I create the button I want it to store an NSTimer as an argument.

This is the timer and the cr

6条回答
  •  渐次进展
    2021-01-06 11:10

    You can create subclass of UIButton, add property in this subclass, store your object in this property and get it in action method through sender.

提交回复
热议问题