Serialization vs. Archiving?

前端 未结 3 2116
你的背包
你的背包 2020-12-19 08:33

The iOS docs differentiate between \"serializing\" and \"archiving.\" Is this a general distinction (i.e., holds in other languages) or is it specific to Objective-C? Also,

3条回答
  •  难免孤独
    2020-12-19 09:25

    This is a case of one being the other some (but not all) of the time.

    Wikipedia has this to say about serialization:

    "Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be "resurrected" later in the same or another computer environment"

    So, archiving may only be serialization, but it could also be the combination of serialization and compresssion, for example. Or perhaps it adds some kind of header info. So serialization is a form of archive, but an archive is not necessarily a serialization.

    This isn't really specific to iOS - these terms are thrown around all over. Their specific meaning in the context of iOS could be quite specific, though.

提交回复
热议问题