Re: newbie memory question
Re: newbie memory question
- Subject: Re: newbie memory question
- From: Andres Santiago Perez-Bergquist <email@hidden>
- Date: Sun, 30 Nov 2003 16:09:45 -0500
On 30 Nov 2003, at 3:57 PM, pmcurry wrote:
NSData* data = [[notice userInfo] objectForKey:
NSFileHandleNotificationDataItem];
NSString* string = [[NSString alloc] initWithData: data encoding:
[NSString defaultCStringEncoding]];
NSArray* components = [string componentsSeparatedByString:@"\n"];
Can I assume these three lines are using 'convenience type' calls and
I'm not responsible for releasing any of the objects created in the
process? I'm still memory gun-shy.
Correct for the first and third lines, wrong for the second. Whenever
you alloc or copy, the resulting object has a retain count of one.
-- Andres Santiago Perez-Bergquist
_______________________________________________
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.