IT English Collection(28)of Property list

1 前言

    本文主要介绍了plist(Property list)的相关介绍。

    转载请注明转自:http://blog.csdn.net/developer_zhang

2 详述

2.1 原文

  A property list is arepresentation of a hierarchy of objects that can be stored in the file system andreconstituted later. Property lists give applications a lightweight and portable way to store small amounts of data. They are hierarchies of data made from specific types of objects—they are, in effect, an object graph. Property lists are easy to create programmatically and are even easier to serialize into a representation that is persistent. Applications can later read the static representation back into memory and recreate the original hierarchy of objects. Both Cocoa Foundation and Core Foundation have APIs related to property list serialization and deserialization.

Property List Types and Objects


  Property lists consist only of certain types of data: dictionaries, arrays, strings, numbers (integer and float), dates, binary data, and Boolean values. Dictionaries and arrays are special types because they are collections; they can contain one or multiple data types, including other dictionaries and arrays. This hierarchical nesting of objects creates a graph of objects. The abstract data types havecorresponding Foundation classes, Core Foundation types, and XML elements for collection objects and value objects, as shown in the following list:


Mutable versions of the Foundation classes are also supported.
  Collectively, instances of these classes are known as property list objects. For example, an NSMutableDictionary object is a property list object, as are NSNumber object, an NSString object, and so on. For a property list to bevalid, all objects in the object graph must be property list objects.

Best Practices for Property Lists
  You can write property lists out in both XML and binary formats. The binary format is much morecompact than the XML version andthus more efficient. It isrecommended for most situations. However, you can manually edit an XML property list if you ever need to. Property list files have the filename extension of plist.

  You should not use property lists to store large, complex graphs of objects, especially when the objects have variable mutability settings. And you cannot use property lists to store objects that are not supported by the architecture, such as model objects. For these cases, use archiving instead. Although property lists can include NSData objects, it’s best to not use data objects in property lists to hold large amounts of binary data.

Property List Serialization
  

  To serialize and deserialize property lists, call theappropriate class methods of the NSPropertyListSerialization class or, if using Core Foundation, thefacilities related to the CFPropertyListRefopaque type. In Cocoa, the serialized output is in the form of an NSData object. You can therefore use the methods of that class (for example, writeToFile:atomically:) to write that data to the file system and use the appropriate NSData class factory memory to read it back into memory. Then, when you deserialize it, you canspecify mutability options for the property list.

2.2 生词

representation[,reprizen'teiʃən]n. 代表;表现;表示法;陈述

reconstituted[,ri:'kɔnstitju:tid]adj. v. 重新设立;重新组成(reconstitute的过去分词形式)

portable['pɔːtəb(ə)l]adj. 手提的,便携式的;轻便的

serialize['siəriəlaiz]vt. 连载,使连续

persistent[pə'sɪst(ə)nt]adj. 固执的,坚持的;持久稳固的

original[ə'rɪdʒɪn(ə)l; ɒ-]n. 原件;原作;原物;原型

deserialization反序列化

nesting['nestɪŋ]n. [计] 嵌套;造巢;镶嵌

corresponding[,kɒrɪ'spɒndɪŋ]adj. 相当的,相应的;一致的;通信的

collectively[kə'lektivli]adv.共同地,全体地

valid['vælɪd]adj. 有效的;有根据的;合法的;正当的

practice['præktɪs]n. 实践;练习;惯例

compact[kəm'pækt]adj. 紧凑的,紧密的;简洁的

thus[ðʌs]adv. 因此;从而;这样;如此

efficient[ɪ'fɪʃ(ə)nt]adj. 有效率的;有能力的;生效的

recommended[rekə'mendid]adj. 被推荐的

manually['mænjuəli]adv. 手动地;用手

complex['kɒmpleks]adj. 复杂的;合成的

mutability[,mju:tə'biləti]n. 易变性;性情不定;突变性

architecture['ɑːkɪtektʃə]n. 建筑学;建筑风格;建筑式样

appropriate[ə'prəʊprɪət]adj. 适当的

facilities[fə'sɪlɪtɪz]n. 设施;工具,设备

opaque[ə(ʊ)'peɪk]adj. 不透明的;不传热的;迟钝的

therefore['ðeəfɔː]adv. 因此;所以

specify['spesɪfaɪ]vt. 指定;详细说明

3 结语

  以上是所有内容,希望对大家有所帮助。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值