Re: [[object autorelease] release]
Re: [[object autorelease] release]
- Subject: Re: [[object autorelease] release]
- From: Finlay Dobbie <email@hidden>
- Date: Mon, 1 Oct 2001 21:33:36 +0100
On Monday, October 1, 2001, at 08:29 PM, Markus Hitter wrote:
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
}
Well don't use a convenience constructor. Use [[NSString alloc]
initWithString:@"Hello"] (stupid anyway, why not just use @"Hello
directly? :-))
-- Finlay