Xcode 8 Objective-C category warning

后端 未结 8 1199
生来不讨喜
生来不讨喜 2020-12-05 09:13

I\'m using Xcode 8 and Swift 3.0. What does this error message mean?

ld: warning: Some object files have incompatible Objective-C category definition

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 09:36

    Rather than marking each member as @nonobjc individually, you can instead mark the entire extension as @nonobjc:

    @nonobjc extension UIStoryboard {
      static let main = UIStoryboard(name: "Main", bundle: nil)
      static let welcome = UIStoryboard(name: "Main", bundle: nil)
    }
    

提交回复
热议问题