iPhone: Fastest way to create a binary Plist with simple key/value strings
- by randombits
What's the best way to create a binary plist on the iPhone with simple string based key/value pairs? I need to create a plist with a list of recipe and ingredients. I then want to be able to read this into an NSDictionary so I can do something like
NSString *ingredients = [recipes objectForKey:@"apple pie"];
I'm reading in an XML data file through an HTTP request and want to parse all of the key value pairs into the plist. The XML might look something like:
<recipes>
   <recipe> 
     <name>apple pie</name>
     <ingredients>apples and pie</ingredients>
   </recipe>
   <recipe>
     <name>cereal</name>
     <ingredients>milk and some other ingredients</ingredients>
   </recipe>
</recipes>
Ideally, I'll be able to write this to a plist at runtime, and then be able to read it and turn it into an NSDictionary later at runtime as well.