If I’m not using garbage collection and I have a auto property set as retain. Should I release the object in my dealloc or does the generated code handle that for me.
More clearly, will the following code leak memory if I don’t release name in dealloc.
Person.h
@interface Person : NSObject {
}
@property (retain) NSString* name;
@end
Person.m
#import "Person.h"
@implementation Person
@synthesize name;
@end
The
retain/assign/copyattributes of a@propertyonly affects how they would behave in the getter and setter. You do need to manually-releasethe ivar in-dealloc.