Re: How can I release an NSString?
Re: How can I release an NSString?
- Subject: Re: How can I release an NSString?
- From: email@hidden
- Date: Sun, 19 Jan 2003 10:51:39 +0100
On dimanche, janvier 19, 2003, at 10:11 AM, Arthur VIGAN wrote:
Hi,
I have a quite simple question, which I find annoying...
Let's consider the following method:
- (NSString *)giveMeAString
{
NSString *aString;
aString = [NSString stringWithString:@"Hello World!"];
return aString
}
My question is: is memory leaking in this code, because the string is
never released? Should I use autorelease?
stringWithString: is returning an autoreleased NSString * so you have
to do nothing.
A good article on retain/release/autorelease is the
http://www.stepwise.com/Articles/Technical/HoldMe.html one and if you
have access to the WWDC 2002 DVD or ADC TV, I strongly recommend
session 302.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.