Properties in dealloc: release then set to nil? or simply release

后端 未结 3 1269
醉酒成梦
醉酒成梦 2020-12-09 22:06

I\'m new to Objective-C (and stackoverflow) and I\'m a little turned around about best practices with regards to properties.

My understanding is that when you\'re c

3条回答
  •  春和景丽
    2020-12-09 22:47

    @Dave DeLong and JeremyP: I think we could say “using inherited messages (direct or indirect by one, calling some part from super) whil „building“ an object (by init…, new… or copy…) is like building a house and placing the roof on it while nobody is sure, if the basement allready is there. And doing so while dealloc might be an equivalent to tear down that house, starting by knocking down the foundation walls, not being sure if being inside its cellar”.

    While using methods without any inheritance might do this too – but if thei’re your own, you can (and have) to controll it.

    Greetings

提交回复
热议问题