Я разрабатываю приложение для iPhone.
У меня есть следующее свойство:
@property (nonatomic, retain) Point2D* endPoint;
И это метод того же класса:
- (id)initWithX:(CGFloat)x Y:(CGFloat)y;
{
if (self = [super init])
{
endPoint = [[Point2D alloc] initWithX:x Y:y];
...
}
И, наконец, метод dealloc для того же класса:
- (void)dealloc {
[endPoint release];
[super dealloc];
}
Мой вопрос, верен ли этот код?
endPoint = [[Point2D alloc] initWithX:x Y:y];
Или, может быть, мне нужно сделать здесь авто-релиз.