gpt4 book ai didi

ios - 关于 XCode (Swift) 中选择器的快速问答

转载 作者:行者123 更新时间:2023-11-30 13:12:44 25 4
gpt4 key购买 nike

基本上,我一直在使用 Apple 的 Start Developing iOS Apps (Swift) 进行学习,但我遇到了一些根本无法工作的代码 - Apple 版本也是如此。

button.addTarget(self, action: #selector(RatingControl.ratingButtonTapped(_:)), 
forControlEvents: .TouchDown)

错误是:

  1. 预期的“,”分隔符(两次“action:”和“#selector”之间)

  2. 表达式列表中的预期表达式

最佳答案

您必须在代码中定义函数评级 Button Taped()。

关于ios - 关于 XCode (Swift) 中选择器的快速问答,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38558722/

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