Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Most software would store information in XML rather like this:

<book>
  <title>Generic Examples, the Internet, and You</title>
  <length pages="43" />
  <authors>
    <person>Yolanda Squatpump</person>
    <collective>
      Anonymous 1
      Anonymous 2
      <et.al />
    </collective>
  </authors>
</book>

Whereas Apple's .plists would resemble:

<plist version="1.0">
<dict>
  <key>Label</key>
  <string>book</string>
  <key>title</key>
  <string>Generic Examples, the Internet, and You</string>
  <key>length</key>
  <dict>
    <key>pages</key>
    <integer>43</integer>
  </dict>
  <key>authors</key>
  <dict>
    <key>person</key>
    <string>Yolanda Squatpump</string>
    <key>collective</key>
    <array>
      <string>Anonymous 1</string>
      <string>Anonymous 2</string>
    </array>
  </dict>
</dict>
</plist>

Why?

share|improve this question

closed as not constructive by bmike Nov 1 '12 at 19:29

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
As written, this invites people to offer any idea why the designers chose to pick a certain style and lacks a clear problem you are trying to solve (other than wanting a discussion on this). Would you have a crack at editing this per the faq guidelines or ask on Ask Different Meta for help before flagging this to be reopened? There could be a good underlying question, but I can't guess it to edit it in as written. –  bmike Nov 1 '12 at 19:29
    
The XML format is based on the old-style format that only supports NSString, NSData, NSArray, and NSDictionary. –  ؘؘؘ Nov 2 '12 at 13:38

1 Answer 1

I imagine the primary reason is that property lists are designed to be easily accessed by Objective-C programs. Every iOS and OS X program at a minimum uses a property list for communicating basic information about itself to the system, and most use them frequently in their code, particularly for storing preferences (this is why most apps settings are accessible via the defaults command).

Property lists in Obj-C are defined as a dictionary type that contains only strings, numbers, arrays, dates, raw bytes and other dictionaries. Prescribing exactly what types a property list can contain means you can access any one and know what to expect. Allowing more free-form XML elements would increase complexity and require a lot of reworking existing code, for not much benefit.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.