I am not sure if this is an early swift bug or if I am doing something wrong. I have my custom class object that I want to save on the user defaults. For that I need to encode NSData
of my custom object:
var myEncodedObject:NSData = NSKeyedArchiver.archivedDataWithRootObject(myObject)
The thing is that I am getting an error and I think this could be a bug.
2014-07-05 15:25:35.317 myAppName[12323:1008333] -[_myAppName encodeWithCoder:]: unrecognized selector sent to instance 0x1190c7f0
2014-07-05 15:25:35.323 myAppName[12323:1008333] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_myAppName encodeWithCoder:]: unrecognized selector sent to instance 0x1190c7f0'
Anyone having the same problem or know how to bypass this?