NSArchiving exception

Hi guys,

i am trying to encode an Employee object and i am always getting an exception in the method:

aCoder.encodeObject(name, forKey: "name")

I even created a new command line project to simplify debugging. The code is the following:

[code]import Cocoa

class Employee: NSObject, NSCoding {
var name: String = “New Employee”
var raise: Float = 0.05

override init() {
    super.init()
}

// MARK: - NSCoding
func encodeWithCoder(aCoder: NSCoder) {
    aCoder.encodeObject(name, forKey: "name")
    aCoder.encodeFloat(raise, forKey: "raise")
}

required init(coder aDecoder: NSCoder) {
    name = aDecoder.decodeObjectForKey("name") as! String
    raise = aDecoder.decodeFloatForKey("raise")
    super.init()
}

}

let e = Employee()
let data = NSArchiver.archivedDataWithRootObject(e)[/code]

The exception i get is the following:

I use XCode 6.4

You could try using NSKeyedArchiver instead of NSArchiver.