Alex, > On May 9, 2021, at 15:15, Steve Mykytyn via Cocoa-dev > <cocoa-dev@lists.apple.com> wrote: > > You're creating your own problem here.
Agreed, If you have control. I would either make all top level objects arrays, or dictionaries. If your writing the plist and its a dict, wrap it in an array, or vice versa, embed arrays in a dict with meta data keys, as suggested. Of course, if you have the flexibility to do this. If not, I’d create a single point of access to read the plists and have logic inside to handle the non-homogeneous top level objects and return a consistent data structure for consumption. Sandor > If you are controlling what the > configuration plist is, make it a dictionary at the top level with three > keys and entries: > > idString - something that confirms to you that this is one of yours > array - the array you want in some cases > dictionary - the dictionary you want in some cases. > > Then you deserialize it, confirm it's one of yours, and branch on which of > the latter two keys is not null. > > This kind of situation can arise if you are configuring multiple apps out > of the same code base. > > If you're not controlling the configuration plist, just use > NSPropertyListSerialization as noted previously and branch on what you get. > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com > > This email sent to admin.szatmari....@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com