Xcode 8 Objective-C category warning

后端 未结 8 1183
生来不讨喜
生来不讨喜 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:50

    I was able to solve my problem when I changed the "class var" to "class func":

    There was:

    class var applicationVersionNumber: String {
        if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
            return version
        }
        return "Version Number Not Available"
    }
    

    Has become:

    class func applicationVersionNumber() -> String {
        if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
            return version
        }
        return "Version Number Not Available"
    }
    

    Source: https://forums.developer.apple.com/message/146579#146579

    0 讨论(0)
  • 2020-12-05 09:53

    Google Analytics pod

    In Build Settings -> Other Linker Flags if you have the -ObjC on -l"GoogleAnalytics" flag this warning will appear. I don`t know why or how to resolve, but can be your problem too.

    0 讨论(0)
提交回复
热议问题