Create NSDictionary file in windows(c#)?
My iphone app creates files using the my custom ".ops" extension. using NSDictionary. Nsdictionary goes like this:
nsdictionary = nsdictionary withObjectsForKeys:
nameField.text , @"name",
descField.text, @"description",
author.text, @"author",
ItemArray, @"values", nil;
//ItemArrays objects are strings: @"red", @"blue", @"green";
I use writeToFile to save the nsdictionary to "name.ops" in the DocumnetLibrary. However I wonder if using C#, I could make the same file(开发者_开发问答name.ops) with the same properties(name, desc etc) and the strings array and extension and still be able to import and open that file in my iphone app?
Well I want to make the same app in the windows platform too. Since creating a new .ops file in the iphone small screen is hard. So I want to make it simple to create ops files!
How could I implement this?
so your .ops files are plists with a custom extension?
plists are xml files. You should be able to create them in every language you want.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>key 1</key>
<string>value 1</string>
<key>key 2</key>
<true/>
<key>key 3</key>
<integer>12</integer>
</dict>
</plist>
Open one of your .ops files with TextEdit and see how they look like.
精彩评论