Advantages and disadvantages of encoding objects with NSCoding or simply writing data to files?

Well, most NSCoding implementations will handle object graphs correctly; i.e. If you code a member object that's already been coded to the coder, it won't code it again. Decoding will restore the object graph correctly (so the decoded target object has multiple inbound references).

You also get all the built in helper coding functions (for primitive types, and objects) Other than that NSCoder s are just persistence object generators, so you end up doing similar work, only without the annoyances and common cases handled by Apple. What persistence generator could you write that wouldn't duplicate tonnes of NSCoder functionality?

Well, most NSCoding implementations will handle object graphs correctly; i.e. If you code a member object that's already been coded to the coder, it won't code it again. Decoding will restore the object graph correctly (so the decoded target object has multiple inbound references).

You also get all the built in helper coding functions (for primitive types, and objects). Other than that, NSCoders are just persistence object generators, so you end up doing similar work, only without the annoyances and common cases handled by Apple. What persistence generator could you write that wouldn't duplicate tonnes of NSCoder functionality?

Thanks @Adam Wright, I'm new to developing iPhone applications and my book of choice didn't bother explaining the practical differences between simply writing persistance objects to disk or doing so with the NSCoding Protocol methods. – Casey Flynn Dec 6 '10 at 19:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions