KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
There are a lot of cases in which one would alloc an instance, and release it right after it's being assigned to something else, which retains it internally. For example, UIView *view = [[UIView alloc] initWithFrame...]; [self addSubView:view]; [view release]; I have heard people suggesting that we go with autorelease rather than release right after. So the above becomes: UIView *view = [[[UIView alloc] initWithFrame...] autorelease]; [self addSubView:view]; What's the best practice here? Pros and cons?
Tags (comma-separated)
Save Edits
Cancel