何时需要NSCopying? [英] When is NSCopying needed?

查看:73
本文介绍了何时需要NSCopying?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道是否需要将您的对象用作NSDictionary中的键。

I know it's needed if your object will be used as a key in an NSDictionary. Are there any other times like this that NSCopying is required?

如果我认为不需要我的模型对象符合NSCopying,是否可能是错误的?

If I think I don't need my model objects to conform to NSCopying, am I probably wrong?

推荐答案

当将其传递给copy属性或记录为复制其参数的任何其他方法时。

When it's being passed to a copy property or any other method that is documented as copying its argument.

这篇关于何时需要NSCopying?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆