开发者

setEnabled Not working on UIButton

开发者 https://www.devze.com 2023-04-11 21:44 出处:网络
I disable a button with [myButton开发者_如何学编程 setEnabled: NO]. Then, I try to enable it with [myButton setEnabled: YES]. And nothing happens. Do I forgot something?Check out your interface builde

I disable a button with [myButton开发者_如何学编程 setEnabled: NO]. Then, I try to enable it with [myButton setEnabled: YES]. And nothing happens. Do I forgot something?


Check out your interface builder, maybe forgot to hook up your button to the outlet..


The code you are describing to enable the button is correct. The next thing to check would be if that code is actually getting called, or if, for some reason, the code never reaches that line.

0

精彩评论

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

关注公众号