Do you need to release parameters of methods at the end of them in Objective-C?

后端 未结 4 815
说谎
说谎 2020-12-05 11:21

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

4条回答
  •  误落风尘
    2020-12-05 12:14

    You need to release them only, if you retain them in your method. The convention is, that the caller is responsible to make sure, that the objects passed as arguments live at least as long as the call is active.

提交回复
热议问题