Post

Replies

Boosts

Views

Activity

Reply to NSKeyedUnarchiver validateAllowedClass error
When debugging a message such as: [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x205da88f8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(     "'NSDictionary' (0x205da1178) [/System/Library/Frameworks/CoreFoundation.framework]",     "'NSString' (0x205da8948) [/System/Library/Frameworks/Foundation.framework]" )}'. This will be disallowed in the future. you want to look for a use of NSKeyedUnarchiver where you only list NSDictionary and NSString. Then you want to add NSNumber. Do not add NSObject.
Sep ’22
Reply to How do I store FileManager.ubiquityIdentityToken?
I was dealing with this same issue in some older Objective-C code I was trying to update. After lots of different attempts I found the following solution (Swift version): if let token = FileManager.default.ubiquityIdentityToken {     do {         let data = try NSKeyedArchiver.archivedData(withRootObject: token, requiringSecureCoding: true)         if let newToken = try NSKeyedUnarchiver.unarchivedObject(ofClass: NSData.self, from: data) {             print("We got the token")             if newToken.isEqual(token) {                 print("tokens match")             } else {                 print("tokens do not match")             }         }     } catch {         print("oops: ", error)     } } This works and it compiles cleanly. But I'm worried that passing in NSData.self could possibly fail in some future implementation if Apple changes how the token is encoded.
Jul ’22
Reply to How to change the app name shown in a Catalyst app?
So it seems that the name of the app shown in a Mac Catalyst app comes from the "Product Name" build setting for your target. I changed that from MyCoolApp to My Cool App and I started seeing the results I wanted. I find it odd that the app display name comes from the resulting .app name and the executable name and not the "Bundle display name" from Info.plist. Maybe this will help someone else.
Jan ’21