Extension to class for NSCoding protocol conformance
Extension to class for NSCoding protocol conformance
- Subject: Extension to class for NSCoding protocol conformance
- From: Jaikanth CK <email@hidden>
- Date: Sat, 25 Oct 2014 20:45:52 +0530
Hi All,
I need to extend a class for NSCoding protocol conformance.
I tried the following code in the playground and get an error - required
initialiser cannot be declared in the extension. If I do not make it
required, I get an error asking to make it required ...and so on
class first : NSObject {
var name = "string" }
class second : first {
var age:Int
override init() { age = 21 }
}
extension second : NSCoding {
func encodeWithCoder(aCoder: NSCoder) {
}
required convenience init(coder aDecoder: NSCoder) {
self.init()
}
}
Any help is appreciated.
Regards,
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden