Property cannot be marked @objc

2019-09-29  本文已影响0人  Dove_iOS

oc调用swift, 访问Bool属性isRegist时:

@objc var isRegist: Bool?

报错: Property cannot be marked @objc because its type cannot be represented in Objective-C

@objc var isRegist:Bool = false { //此处一定要给初始值
    willSet{
    }
    didSet{
        //处理逻辑
    }
}

 @objc var isRegist:Bool = false 
上一篇下一篇

猜你喜欢

热点阅读