美文网首页
Property cannot be marked @objc

Property cannot be marked @objc

作者: Dove_iOS | 来源:发表于2019-09-29 21:49 被阅读0次

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 

相关文章

网友评论

      本文标题:Property cannot be marked @objc

      本文链接:https://www.haomeiwen.com/subject/whbquctx.html