When does encodeWithCoder get called?

一个人想着一个人 提交于 2019-12-04 08:46:20

You don’t call this method directly. It’s called by a NSCoder subclass if it needs to serialize that object. If you want to encode an object graph use the class methods archivedDataWithRootObject: or archiveRootObject:toFile: of NSKeyedArchiver. This in turn will call the encodeWithCoder: method of your objects. Also note that every object in your array has to implement the NSCoding protocol.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!