ios, web, thoughts & notes (rss)

dreamscape by isak solheim

12 jun 2023 ~


‘unarchiveTopLevelObjectWithData’ was deprecated in iOS 12.0: Use unarchivedObject(ofClass:from:) instead

[general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x1b9e88aa0)
  for key 'root', even though it was not explicitly included in the client allowed classes set:
    "'NSData' (0x1b9e74490) [/Applications/]"
  This will be disallowed in the future.
do {
  guard let decodedData = try NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSData.self, NSNumber.self], from: data) as? T else {
    return .failure(.decode)
  return .success(decodedData)
} catch {
  return .failure(.decode)