文件存储类型总结

2020-04-01  本文已影响0人  小千

1、Property Lists

属性列表,扩展名为plist。

A property list can be stored in one of three different ways: in an XML representation, in a binary format, or in an “old-style” ASCII format inherited from OpenStep. You can serialize property lists in the XML and binary formats. The serialization API with the old-style format is read-only.

For situations where you need to store small amounts of persistent data—say less than a few hundred kilobytes—property lists offer a uniform and convenient means of organizing, storing, and accessing the data.
In some situations, the property-list architecture may prove insufficient. If you need a way to store large, complex graphs of objects, objects not supported by the property-list architecture, or objects whose mutability settings must be retained, use archiving.

2、NSUserDefaults

3、Archive

归档

Archives provide a means to convert objects and values into an architecture-independent stream of bytes that preserves the identity of and the relationships between the objects and values.

3、DB

数据库可以提供对数据更加高级的操作,这是其他方式不能提供的。当涉及到建模,查询,遍历,持久化复杂的对象图,就可以采用数据库来实现数据持久化。

上一篇下一篇

猜你喜欢

热点阅读