I am currently using NSCoding to save an array of Int variables like this:
var myArray = [Int]()
myArray = aDecoder.decodeObjectForKey("MyArray") as! [(Int)]
aCoder.encodeObject(myArray, forKey: "MyArray")
I now need to save an array of Int64 variables. I thought it would be simple, so I did this:
var myNewArray = [Int64]()
myNewArray = aDecoder.decodeObjectForKey("MyNewArray") as! [(Int64)]
aCoder.encodeObject(myNewArray, forKey: "MyNewArray")
However I get an error on the last line: Cannot convert value of type '[Int64]' to expected argument type 'AnyObject?'
I am puzzled as to why it works with Int but not Int64. How can I achieve this?