Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Apple's documentation on <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Concepts/objectgraphs.html" rel="noreferrer">object graphs</a> has this to say:</p> <blockquote> <p>Mac OS X serializations store a simple hierarchy of value objects, such as dictionaries, arrays, strings, and binary data. The serialization only preserves the values of the objects and their position in the hierarchy. Multiple references to the same value object might result in multiple objects when deserialized. The mutability of the objects is not maintained.</p> <p>…</p> <p>Mac OS X archives store an arbitrarily complex object graph. The archive preserves the identity of every object in the graph and all the relationships it has with all the other objects in the graph. When unarchived, the rebuilt object graph should, with few exceptions, be an exact copy of the original object graph.</p> </blockquote> <p>The way I interpret this is that, if you want to store simple <em>values</em>, serialization (using an NSDictionary, for example) is a fine way to go. If you want to store an <em>object graph</em> of arbitrary types, with uniqueness and mutability preserved, using archives (with NSCoder, for example) is your best bet.</p> <p>You may also want to read Apple's <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/" rel="noreferrer">Archives and Serializations Programming Guide for Cocoa</a>, of which the aforelinked page on object graphs is a part, as it covers this topic well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload