-3

Possible Duplicate:
objective c - assign , copy , retain

I want to know the differences between "retain" and copy attribute which used in @property directive in Objective c.

Thanks very much in advance....

Community
  • 1
  • 1
Abhinay
  • 1
  • 1

1 Answers1

0

copy copies the content of the variable (and sets 1 the retain count). Retains simply add a +1 to the retain count. So... if you have a mutable object and you retains it, if you modify it, the object is "updated" in every property with "retain", but not in the ones with "copy". If the object is immutable then there is no difference.

Francesco
  • 1,840
  • 19
  • 24