Xcode 8 Objective-C category warning

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

    In my case it was a class variable.

    public extension NSObject {
        public class var nameOfClass: String{
            return NSStringFromClass(self).components(separatedBy: ".").last!
        }
    

    Adding @nonobjc helped.

提交回复
热议问题