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