Skip to content

-[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x1e1552fd8) [/System/Library/Frameworks/Foundation.framework]' #178

@bukira

Description

@bukira

I am getting the following error

-[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x1e1552fd8) [/System/Library/Frameworks/Foundation.framework]' for key '********', even though it was not explicitly included in the client allowed classes set: '{( )}'. This will be disallowed in the future.

I think this is an error in Defaults as I am using defaults to save a custom object and the object conforms to __DefaultsSerializable_

if found this

Specifying the type here fixed it: override static var allowedTopLevelClasses: [AnyClass] {
return [NSArray.self, NSString.self]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions