Can开发者_如何学C i found a class to transform a plist file (nsdictionnary with string) ?
There is a ruby gem for this that can be found here:
https://rubygems.org/gems/csv_to_plist
You can download it by running
$ gem install csv_to_plist
Then you will be able to run
$ csv_to_plist my_file.csv
No, there is no such generic solution.
A plist, by it's nature, is a hierarchical format.
A csv file, by contrast, is a tabular format.
Any conversion between the two will be highly specialised, although generally speaking, you can convert tabular data formats to a hierachical format, but the conversion will be very inefficient. The reverse, however, is not generally possible in most situations.
For an NSDictionary, however, a conversion is possible, say, with a CSV file with a "Keys" column and a "Values" column, if the keys and values are both very primitive types (such as a string), but this is a very, very small subset of what plists can contain.
精彩评论