I'm trying to encode some class properties according to the NSCoding protocol:
func encode(with aCoder: NSCoder){
// a Date
aCoder.encode(startDate, forKey: "startDate");
// a ()->()
aCoder.encode(handler, forKey: "handler"); //1
// a Boolean
aCoder.encode(rightAway, forKey: "rightAway");
}
I've isolated the problem to be on the line marked with 1. If i comment that line, everything runs okay. If i do run that line as well, i get unrecognized selector
. Is there any special care to take when encoding closures? Thanks in advance.