4 ms·
because like I said it's easy to forget when to do that. Example UIView* view = [[UIView alloc] init]; ...do a bunch of stuff [view release] <-- you have to re
by Hisoka 15y ago
because like I said it's easy to forget when to do that. Example
UIView* view = [[UIView alloc] init];
...do a bunch of stuff
[view release] <-- you have to remember this
vs.
UIView* view = [[[UIView alloc] init] autorelease];
Of course I know about the cases where we have tight loops,w hich is why i said 99 of the time.
- marcomonteiro 15y agoPersonally I only use autorelease when I create an object I'm not responsible for. For example, if I create a view somewhere for another object to utilize. I also like knowing that as soon as I'm done with an object that it gets killed and the system can reclaim the memory.