• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSecureCoding & Nested Collections & macOS 11
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSecureCoding & Nested Collections & macOS 11


  • Subject: NSSecureCoding & Nested Collections & macOS 11
  • From: Markus Spoettl via Cocoa-dev <email@hidden>
  • Date: Thu, 3 Sep 2020 12:15:55 +0200

Hi,

my app implements secure decoding for all its serialization and it worked fine up until macOS 11. Now the deserialization chokes on nested collections like this

NSArray of NSDictionary containing [NSNumber, NSString, NSDate] (both keys and
objects)

What previously worked no longer does:

NSSet *allClasses = [NSSet setWithObjects:
                        [NSArray class], [NSDictionary class],
                        [NSNumber class], [NSString class], [NSDate class],
                        nil];

[decoder decodeObjectOfClasses:allClasses forKey:@"somekey"];

On macOS 11 this produces the following exception:

------------------------------
-[NSKeyedUnarchiver _validateDecodeCollectionAllowedClassesRequirementsWithClasses:]: This method only supports decoding non-nested collections. Please remove the following or use '-decodeObjectOfClasses: forKey:' instead:
        (
                NSDictionary (0x7fff88714520)
[/System/Library/Frameworks/CoreFoundation.framework]
        )
------------------------------

Of course leaving out NSDictionary produces a different exception about the decode encountering an NSDictionary object.

Something has changed, obviously. Can someone enlighten me how one is supposed to decode those kinds of objects? It's no option to change the encoding.

Thanks for any pointers

Regards
Markus

--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSSecureCoding & Nested Collections & macOS 11
      • From: Markus Spoettl via Cocoa-dev <email@hidden>
    • Re: NSSecureCoding & Nested Collections & macOS 11
      • From: Jens Alfke via Cocoa-dev <email@hidden>
  • Prev by Date: Re: Free trial period for apps in Mac App Store (?)
  • Next by Date: Re: NSSecureCoding & Nested Collections & macOS 11
  • Previous by thread: Re: Invalidating UIImageView's image cache
  • Next by thread: Re: NSSecureCoding & Nested Collections & macOS 11
  • Index(es):
    • Date
    • Thread