I'm working with a team of Android Developers while I'm working on iOS. They use XML files for a lot of data. Since we want the data between us to stay consistent - we want to be able to have shared XML files to use in our projects.
I know .plist is basically a type of XML, but I want to be able to get the regular shared XML file, turn it into a .plist, and then use it in my IOS project.
I searched the web for this one and mostly found Obj-C answers or outdated answers.
Any known method of doing it at all? If so, is it possible to do it automatically somehow? (script or something of that sort. Maybe even do it locally inside the application?)
A .plist file is a very specific XML file with only a small set of keys allowed. A random XML file will not be convertible to a .plist file.
Try converting your file to JSON first. If you can convert it to JSON you will be able to automatically convert it to a .plist after that using the plutil
command with the xml1
or binary1
format.
plutil -convert xml1 -o output.plist input.json
If you can't convert it to JSON, you can keep your XML file as is and parse it in your app using NSXMLParser
. XML is harder to parse than .plist or JSON files, but aside from that the difference should be minimal.