Does @property(retain) need a release?

前端 未结 3 611
故里飘歌
故里飘歌 2021-01-14 10:42

Below are three fragments of code, the first two are interfaces for two objects along with a couple of @property commands. Please note that this is just me learning, its not

相关标签:
3条回答
  • 2021-01-14 11:16

    you must call release by hands for each time you've called retain or alloc method.

    0 讨论(0)
  • 2021-01-14 11:26

    Yes, by setting it to nil or calling release depending on OS.

    0 讨论(0)
  • 2021-01-14 11:28

    If you are targeting Mac OS X, the best answer would be to turn on garbage collection and delete the -dealloc method.

    To answer the specific question, you need to release both name and system in your -dealloc method.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题