How do you pass a variable to the UIAlertView delegate?

前端 未结 6 1331
刺人心
刺人心 2020-12-28 16:22

How do you pass a variable to the UIAlertView delegate?

I have a variable that I want to use in the alert view delegate. It is only used in the functio

6条回答
  •  再見小時候
    2020-12-28 17:00

    Subclass UIAlertView, add a property called userInfo with type of your choice. Set the user info value at the time you create an instance of Subclassed UIAlertView, and retrieve it from within the delegate method. (There you will get the subclassed instance which holds the userInfo)

提交回复
热议问题