Convert JSON to .plist
Asked Answered
G

4

40

I have a JSON file that I exported from a web service. I need to convert this to a .plist file that I can import into the main bundle of an iOS app. What's the easiest way to do this?

Note - the app doesn't need to grab the JSON from a server or anything. This is a one-time conversion that I need to do. The app will always just use the plist. I just need to know how to convert it.

Gust answered 14/11, 2012 at 18:47 Comment(0)
G
85

I'd recommend plutil on the command line.

plutil -convert xml1 in.json -o out.plist

It will blow up with NULL values in dictionaries and some other inconsistencies that iOS JSON deserialization will handle more gracefully, but it does appear to work pretty well.

Gerhardine answered 1/1, 2013 at 22:58 Comment(0)
C
20

I have a web app to convert data between JSON and PList:

https://github.com/fengchang/json2plist

Corporation answered 9/9, 2014 at 2:18 Comment(0)
E
2

David's answer works pretty well, but as a Ruby lover I've written a very simple tool to do the same with ruby: https://github.com/javiertoledo/json2plist

Epigenesis answered 18/12, 2013 at 18:44 Comment(0)
T
0

another online converter JSON to PList https://wtools.io/convert-json-to-plist

Trimolecular answered 8/1, 2021 at 20:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.