【发布时间】:2011-04-24 21:06:09
【问题描述】:
我在标题中有以下内容:
@property (nonatomic, retain) UIView *overlay;
在实现中:
@synthesize overlay;
然后:
UIView *tempOverlay = [[UIView alloc] initWithFrame:CGRectMake(160.0f, 70.0f, 150.0f, 310.0f)];
self.overlay = tempOverlay;
[tempOverlay release];
上面的tempOverlay变量不是没必要吗?我不能这样做吗:
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(160.0f, 70.0f, 150.0f, 310.0f)];
【问题讨论】:
标签: iphone objective-c memory-management properties retain