Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's not clear if you want to do the conversion on the iPhone or on the server. If it's on the server and you can use the Cocoa frameworks, the <code>NSPropertyListSerialization</code> provides services to convert between the supported plist types (string, XML, and binary) on OS X (since 10.2). There are also analogous methods in the Core Foundation library if you'd prefer to use that instead.</p> <p>To convert an XML plist to a binary one:</p> <pre><code>NSString *xmlPlistPath; // already set NSString *outPath; // already set NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; plistData = [NSData dataWithContentsOfFile:xmlPlistPath]; plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&amp;format errorDescription:&amp;error]; if(plist == nil) { // unable to parse plist //deal with failure -- error gives description of the error } else { binaryPlistData = [NSPropertyListSerialization dataFromPropertyList:plist format:NSPropertyListBinaryFormat_v1_0 errorDescription:&amp;error]; if(binaryPlistData == nil) {//unable to create serialized plist // deal with failure -- error gives description of the error } if(![binaryPlistData writeToFile:outPath atomically:YES]) { // unable to write file } } </code></pre> <p>See <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/SerializedPListsConcept.html#//apple_ref/doc/uid/20001016-55191" rel="noreferrer">Property List Pramming Guide</a> page on developer.apple.com for more information.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload