Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bukira opened this issue Jun 13, 2024 · 2 comments

Comments

@bukira
Copy link

bukira commented Jun 13, 2024

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]
}

@sindresorhus
Copy link
Owner

Is it a logged warning or an error?

It would be great if you could submit a failing test.

@bukira
Copy link
Author

bukira commented Jun 13, 2024

it is a logged warning, it works fine now but I get the error repeatedly every time I access Defaults[.myValue]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants