SOLVED. I did log a message before each call of decoder.decodeObject(of: key:) That let me find the issue, and replace: self.aVar = decoder.decodeObject(of: NSArray.self, forKey: someKey) as? someClass by self.aVar = decoder.decodeObject(of: [NSArray.self, NSSet.self, NSNumber.self], forKey: someKey) as? someClass Effectively, someClass has properties that have NSSet properties as well as Int. That was my error, but I still think that Xcode should be able to guess this and provide clearer messages or propose autocompletion. Not yet the case in Xcode 16.4 nor 26.2. I'll file a bug report for enhancement.
Topic:
App & System Services
SubTopic:
General
Tags: