属性列表支持的ObjC类型 [英] Property list supported ObjC types

查看:92
本文介绍了属性列表支持的ObjC类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否正确地说属性列表文件(.plist)仅处理NSStringNSNumberNSDateNSData(允许存储符合NSCoder的任何其他类型)+ /NSDictionary的那些类型?

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?

推荐答案

是的,这几乎就是属性列表的确切定义. Wikipedia有一个小表,该表说明了如何将每个类存储在生成的XML文件中:

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

这篇关于属性列表支持的ObjC类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆