Skip to content

Loading…

Added NSCoding support #2

Merged
merged 0 commits into from

2 participants

@0xced

No description provided.

@nfarina
Owner

Keeping the original data around is definitely a clever way to accomplish NSCoding support with little code. But I don't like keeping it around for the lifetime of the document, it seems inelegant, and a not-insignificant amount of memory baggage.

I do see how making SMXMLElement properly implement NSCoding would add a lot of annoying boilerplate code though. So I'm torn.

Perhaps -description could take an option not to truncate the node values? Then the document could be encoded as a single string, and later decoded by reparsing.

@0xced

With the current implementation, namespaces are lost. By keeping the data instead of a reconstructed xml, we can keep information about namespaces that could be later read if namespace support is added to SMXMLDocument.

@nfarina
Owner

If namespaces were supported, wouldn't they make it into the -description output as well?

@0xced 0xced merged commit a42868e into nfarina:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 0 additions and 0 deletions.
Something went wrong with that request. Please try again.