相关疑难解决方法(0)

iOS Xcode 12.0 Swift 5 'AppDelegate' 用@main 注释并且必须提供类型为 () -> Void 或 () throws -> Void 的主要静态函数

在我使用 Swift 5 和 Catalina 10.15.5 的 Xcode 12.0 中:当我勾选 Mac 作为可部署目标(Apple Project Catalyst)并单击运行时,它给了我一个错误显示:

'AppDelegate' is annotated with @main and must provide a main static function of type () -> Void or () throws -> Void.
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

在互联网上找不到任何东西......我检查了我的代码,没有任何问题,它可以在 iOS 设备和模拟器上运行。调试日志为空(废话...)

有人面临这个问题吗?

macos xcode swift5

11
推荐指数
1
解决办法
2764
查看次数

标签 统计

macos ×1

swift5 ×1

xcode ×1