你需要在Objective-C中释放方法的参数吗? [英] Do you need to release parameters of methods at the end of them in Objective-C?

查看:29
本文介绍了你需要在Objective-C中释放方法的参数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个参数传递给一个方法,是否需要在方法结束时释放参数?

If I have a parameter passed to a method, do I need to release the parameter at the end of the method?

推荐答案

没有.想想 NARC:新分配保留副本".如果你没有做任何这些事情,你就不需要发布.

No. Think NARC: "New Alloc Retain Copy". If you are not doing any of those things, you don't need to release.

这篇关于你需要在Objective-C中释放方法的参数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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