Saving an Array of Dictionary to Plist file

Hi, I am trying to save an array of dictionary’s to a plist file but it is not working?

the array is

‘let myArray = Array<Dictionary<String, Any>>’

When I go to save it to the plist file the option for ‘.write’ is not there :frowning:

Please can anyone help?

Thanks
John

Hi @jlock45

You need to cast your array to a NSArray. So something like this should work:
(myArray as NSArray).write(....)

I hope this is helpful.

Nikita

2 Likes