I am pretty sure I am doing this right, but just wanted to check. I have two instance variables that have accessors created via @property. In my dealloc (for the same object) I am releasing these objects.
@property(copy) NSString *firName;
@property(copy) NSString *surName;
-(void)dealloc {
NSLog(@"_deal: %@", self);
[firName release];
[surName release];
[super dealloc];
}
gary
Yes, that's correct.
The implementation of the property will call release
on the previous value before copying the new value, so the only memory management you have to worry about is releasing in the dealloc
method, which you're doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With