I have read a lot of topics about getters and setters. I know what they are and why are useful. Different source claim's different ways to release the ivars. Here begins my confusion
@interface CoolClass : NSObject
{
NSString *name;
}
@property (nonatomic, copy) NSString *name;
@end
@implementation CoolClass
@synthesize name = _name;
-(id)init
{
if(super = [self super])
{
self.name = @"Jo";
}
return self;
}
-(void)dealloc
{
[self.name release], self.name = nil;
}
@end
Is that the correct way to release/free ivars ?