A simple memory management problem as below:
-(void)viewDidLoad
{
......
self.label = [[[UILabel alloc] initWithFrame:labelFrame] autorelease];
......
}
I think label is a global variable, according to the management protocol, if you create a instance with “alloc”, you should just “dealloc” it, why “autorelease” here?
versus
are essentially the same as far as proper memory management goes. The memory will be properly cleaned up, just at different times.
I would assume that the property of that label would be something like
@property(nonatomic,retain)so the label continues to exist since it was retained by the property when you callself.label.