ios - 归档应用程序时为 "Use of unresolved identifier"

标签 ios swift compilation swiftui appdelegate

我在 Xcode 项目中有一个自定义的 Swift 类,我们将其命名为 CustomClass 归档时,出现以下错误:

Use of unresolved identifier 'CustomClass'

在我调用那个类的每个文件中。由于此类只是创建一个 UIViewController,因此我已将方法调用的输出替换为 UIViewController() 调用。

然后,我在存档期间收到以下错误:

Entry point (_main) undefined. for architecture arm64

我检查了我的 AppDelegate 文件并发现类定义是正确的:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

由于存在 @UIApplicationMain 声明,因此应该有一个入口点。

此问题的根本原因可能是什么?

Xcode 11.2.1 GM 种子

请注意,问题仅在归档时发生,而不是在创建调试版本时发生。我还可以在我的设备上安装该应用程序。

最佳答案

检查文件的目标成员。选择文件,然后在底部的一个角(文件检查器部分)您可以看到目标成员。

关于ios - 归档应用程序时为 "Use of unresolved identifier",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58793239/

相关文章:

ios - 在 Apps Hierarchy 中替换 Storyboard 的正确方法,而不是 Presenting over

ios - 如何在 Firestore 中构建搜索列表?

c++ - 在 Linux 上编译错误但在 MacOSX 上没有

linux - 为 arm 编译 rtmpdump

ios - 如何从我的应用程序打开设置页面

ios - 如何在 swift 3 中将 Tableviewcell 显示为气泡?

ios - 如果应用程序被杀死,应用程序在后台时收到的远程通知不会命中 "didReceiveRemoteNotification - fetchCompletionHandler"方法?

ios - 宇宙思维/ Material : How to change CheckButton Selected Colour in iOS

c - 子进程中的篡改检测

ios - 如何为通用 ios 设备构建 Webrtc ios?