开发者

Disable buttons after clicking a button

开发者 https://www.devze.com 2023-03-19 05:51 出处:网络
I am 开发者_如何转开发working on a quiz app and I need to find a way to disable specific buttons in my UIView controller when I press on the correct answer i.e a button. Is there a way to accomplish t

I am 开发者_如何转开发working on a quiz app and I need to find a way to disable specific buttons in my UIView controller when I press on the correct answer i.e a button. Is there a way to accomplish this?

Relevant code:

myButton.enabled = NO;

but I do not have IBOutlets, I have IBActions.


simply create an IBOutlet in the class where your IBAction is, and bind the IBOutlet to you button. then you can use your referring code.

0

精彩评论

暂无评论...
验证码 换一张
取 消