我构建了一个名为“CheckItem”的新数据结构(我正在做一个Todo项目)
我让CheckItem类继承了NSObject和NSCoding
class CheckItem : NSObject,NSCoding {
the hint is : Use of undeclared type ‘NSObject'(and ‘NSCoding’)
全班如下:
class CheckItem : NSObject,NSCoding { var text: String var isDone :Bool var imageName :String init(text: String,isDone: Bool,imageName: String){ self.text = text self.isDone = isDone self.imageName = imageName } init(text: String,isDone: Bool){ self.text = text self.isDone = isDone self.imageName = "No Icon" } }
你能指出我的错误吗?非常感谢你!