Re: java.lang.OutOfMemoryError (Almost SOLVED)

Markus Ruggiero <[email protected]> Sat, 26 Jul 2003 00:33:26 +0200
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <p05200f00bb475f4ce1cb@[192.168.56.11]>
>[snip]
>theSum = [NSNumber numberWithInt:sum];
>/*HERE COMES THE IMPORTANT PART:*/
>[theSum retain];
>[pool release];

This is expected behaviour because [NSNumber numberWith...] returns 
an autoreleased object. By convention most all such class methods 
return autoreleased objects. There are many similar ones like 
[NSArray arrayWith...], [NSString stringWith...] and so on.

---markus---

-- 
rucotec consulting and technologies    email     mailto:[email protected]
rucotec GmbH                                web       http://www.rucotec.ch
Steinentorstrasse 8            
4051 Basel                                  Mobile    +41 (0)79 508 4701
Switzerland                                 Phone/Fax +41 (0)61 271 4990