iOS App Xcode构建错误

问题描述:

我是iOS开发的新手,并且很少遇到构建错误。我在网上查找了如何解决这些错误的信息,但没有得到任何提示。

I am new to iOS development and struggling with few build errors. I looked up the web on how to fix these errors but could not get a hint. Using Xcode 9.4 with built in Swift.


  1. 'LaunchOptionsKey'不是'UIApplication'的成员类型

  2. 实例成员'state'不能用于类型'UIControl'

  3. 实例成员'state'不能用于类型'UIControl'

  4. 类型'UIControl'没有成员'状态'

  1. 'LaunchOptionsKey' is not a member type of 'UIApplication'
  2. Instance member 'state' cannot be used on type 'UIControl'
  3. Instance member 'state' cannot be used on type 'UIControl'
  4. Type 'UIControl' has no member 'State'

下面是链接,因为不允许我在此帖子中包含屏幕截图。

Link is below as I was not allowed to include the screenshot in this post.

Xcode构建错误

应该是这样的:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    return true
}