To follow up on my own post here: Richard: thanks again for your kind help, which i really appreciate.
I was terribly remiss in not looking at NSString.h before posting. The comments in that file naturally back you up: if i want to RELEASE the string myself, i can just use one of the -init... methods (such as -initWithFormat:) I'm still unclear about when temporary strings get free'd (other than when the pool they come from gets free'd), and i'd appreciate any pointers from anybody on just what the connection is between the autorelease pool one creates in main() and its eventual usage (and how it gets passed around), but for now i can just use alloc/init... code. Thanks again to everybody who has helped me, and everybody who is putting together this gnustep creation. dan ------------------------------------------------------------------------------- In article <[EMAIL PROTECTED]>, Dan Hitt <[EMAIL PROTECTED]> wrote: >Hi Richard, > >Thanks very much for your reply, which to summarize for reference >is that a NSString returned by the class method +stringWithFormat: >is owned by an autorelease pool (not me, so i can't free it). ....... >In article <[EMAIL PROTECTED]>, >Richard Frith-Macdonald <[EMAIL PROTECTED]> wrote: >> >>On Sunday, June 15, 2003, at 12:37 am, Dan Hitt wrote: >> ....... >>Yes ... there are a few normal ways to create such objects that will be >>owned by you ... using +alloc...., +new... or -copy.... and >>-mutableCopy... >>Methods with other names return objects that you don't own. >> ....... >> >>When the NSAutoreleasePool object which owns the temporary >>string is destroyed, the string is also destroyed (unless something >>else has retained it). _______________________________________________ Help-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-gnustep
