Property list supported ObjC types
Asked Answered
H

2

0

Is it correct to say that property list files (.plist) only handle NSString, NSNumber, NSDate and NSData (allowing to store any other type which conforms to NSCoder) + NSArray / NSDictionary of those types?

Hesse answered 8/11, 2012 at 18:36 Comment(0)
P
1

Yep, that is pretty much the exact definition of a property list. Wikipedia has a little table that explains how each class will be stored in the resulting XML file:

Foundation class    XML Tag                  Storage format
NSString            <string>                 UTF-8 encoded string
NSNumber            <real>, <integer>        Decimal string
NSNumber            <true />, or <false />   No data (tag only)
NSDate              <date>                   ISO 8601 formatted string
NSData              <data>                   Base64 encoded data
NSArray             <array>                  Can contain any number of child elements
NSDictionary        <dict>                   Alternating <key> tags and plist element tags
Pyriform answered 8/11, 2012 at 18:39 Comment(0)
H
0

Property List can only contains following types of data:

NSString NSNumber NSNumber NSDate NSData NSArray NSDictionary

for more information visit: Property List Format or visit Apple Docs

You can also save other objects as NSData by serializing them

Helle answered 8/11, 2012 at 18:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.