ios - What does retain as property attribute exactly do in objective-c? -


if declare public property :

@property (retain) nsstring * name; 

then how compiler implicitly implement this? have read retain gains ownership on instance variable "_name". have read "retain" message increases reference count of object. each time call setter "name" property in above example, increase reference count?

so after this,

object.name=@"name1"; object.name=@"name2"; 

will reference count 2?

according @blamdarot- "retain" needed when attribute pointer object. setter generated @synthesize retain (aka add retain count) object. need release object when finished it.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -