What are the real differences between NSCoding and NSCopying on the low level?
Also, are they supposed to be used independently, together or when is it good to use which one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NSCopying is closest to what in other languages would be called
clone(), that is, it’s used for immediately creating a (functional) new object as a carbon copy of an existing object.NSCoding is closest to
serialize()/deserialize, that is, it’s used for converting objects to a form that can be persistently stored and revived later, possibly when the program is restarted at some other time.As you can see, they’re not very similar in function, and are definitely supposed to be able to be used independently.