[[object autorelease] release]
[[object autorelease] release]
- Subject: [[object autorelease] release]
- From: Markus Hitter <email@hidden>
- Date: Mon, 1 Oct 2001 21:29:01 +0200
You all might remeber the current discussion "Does Cocoa just leak?"
What I don't understand until today is: Why can't you
explicitely release an autoreleased object? I think this could
be a big performance win in some situations.
Something like:
for (i=0; i<100000; i++) {
myString = [NSString stringWithString:@"Hello"];
[myString doSomething];
[myString release]; // not allowed btw. crashes
}
Of course, there's nothing to enhance for objects created by
sending alloc, then autorelease. In this case you simply omit
the autorelease.
Cheers,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/