I have the following in the header:
@property (nonatomic, retain) UIView *overlay;
And in the implementation:
@synthesize o
Using the retain
attribute specifies that retain
should be invoked on the new object, and the previous value is sent a release
.
So in your second code block, the retain count of the object would become 2, since you no longer release it, and the setter is retaining it. This is unlikely to be what you want.