gpt4 book ai didi

ios - SWIFT:按钮不会在点击时消失

转载 作者:行者123 更新时间:2023-11-29 01:30:33 25 4
gpt4 key购买 nike

当单击 UITableViewCell 中的 UIButton 时,我希望它消失。我尝试了其他 Stack Overflow 帖子中的一些建议,但得到了同样的错误:“ fatal error :在解包可选值时意外发现 nil”。

下面是 View Controller 和我的代码的屏幕截图:

enter image description here

enter image description here

最佳答案

voteButtonLabel 不需要 var,可以将其删除。只需要将错误行替换为 sender.hidden = true

将函数更改为 voteButton(sender:UIButton)

关于ios - SWIFT:按钮不会在点击时消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33516978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com