properties for synthesizing the property : retain / assign
- retain - it is retained, old value is released and it is assigned
- assign - it is only assigned
properties for ownership : IOS5 = strong / weak IOS4 = retain / unsafe_unretained
strong (iOS4 = retain) - i'am the owner, you cannot dealloc this before aim fine with that = retain
weak (iOS4 = unsafe_unretained) - the same thing as assign, no retain or release
so unsafe_unretained == assign?
@property (nonatomic, assign) NSArray * tmp;
is equal to ?
@property (nonatomic, unsafe_unretained) NSArray * tmp;
and vice versa ?
if so, which one to prefer when in iOS4, or why there is (unsafe_unretained) if its exactly same as assign?
and a delegate in iOS4 should be unsafe_unretained or assign?
See Question&Answers more detail:os