views:

45

answers:

1

Example:

@property (..., assign)

there, I don't do any cleanup in the dealloc Method. But when I have an

@property (..., retain)

then I would do so.

I have that from somewhere in the internet. Don't remember the site. Well, I know that the retain-keyword in the compiler directive would make a retain count +1, but actually I think that I missed the deep difference in assign and retain.

+2  A: 

Assign will only copy the pointer, and don't send a retain message to the object. Thus, since you are not retaining it, you don't have to release it.

In case of retain, as you say, it will send a retain message to the object, incrementing its retain count, so you are responsible of sending that object a release message when your object is (in your dealloc).

pgb