Reading a plist file using MonoTouch

What is the best way to download and process a “two-level nested” plist file using MonoTouch? I have a plist file with data (structurally) similar to the following:

- USA
--- New York
--- Chicago
- UK
--- London
--- Edinburgh
- France
--- Paris
--- Lyon

I have Obj C samples that use NSDictionary and NSArray, but I would like to get it as quickly as possible in the standard C # data structure. I could not find complete examples.

+3
source share
2 answers

You can use the .NET System.Xml libraries for reading since . plist is just an XML file. You have the choice of using XPath, a loop with, XmlDocument/XmlNodeor perhaps even LINQ-To-XML (I'm not sure if this is supported in Monotouch).

XML - XmlReader , .

0

, ( LINQ to XML). :

. !

0

Source: https://habr.com/ru/post/1728386/


All Articles