开发者

How to encode a NSInvocation?

Can I fix this with adding a category of <NS开发者_开发问答Coding> methods ?


While Joshua's answer is correct, there is a meta-answer.

You really don't want to archive an NSInvocation. An NSInvocation may contain an arbitrary target, may have been invoked and have an arbitrary return value, and might have any number of arbitrary arguments. Generic archiving is pretty much entirely out of the question.

You are far better off architecting our app such that you archive exactly the set of state you need to recreate an appropriately configured invocation upon unarchival.


Have you tried the documentation? It says:

Note: NSInvocation conforms to the NSCoding protocol, but only supports coding by an NSPortCoder. NSInvocation does not support archiving.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜