I am creating a new data structure called "CheckItem" (I am doing a Todo project)
and I let the CheckItem class inherit NSObject and NSCoding
But Xcode warns of a compile-time error on line 1:
class CheckItem : NSObject,NSCoding {
Hint: Using the undeclared type "NSObject" (and "NSCoding")
The whole class is as follows:
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" } }
Can you point out my mistake? Thank you very much!
source share