如果我沒有使用垃圾回收,並且將自動屬性設置爲保留。我應該釋放我的dealloc中的對象還是生成的代碼爲我處理。在Objective-C中管理自動屬性中的內存設置爲(保留)
更清楚,將下面的代碼泄漏內存,如果我沒有在的dealloc釋放name
。
Person.h
@interface Person : NSObject {
}
@property (retain) NSString* name;
@end
Person.m
#import "Person.h"
@implementation Person
@synthesize name;
@end