Re: Memory Mysteries
Re: Memory Mysteries
- Subject: Re: Memory Mysteries
- From: Clark Cox <email@hidden>
- Date: Fri, 25 Jul 2003 21:01:40 -0400
On Friday, July 25, 2003, at 19:54, email@hidden wrote:
Hello,
I'm a little confused about managing memory in cocoa. I know I should
release objects that have been allocated like this:
NSObject *object = [[NSObject alloc] init];
Yes
But do you release things like this?
NSFileManager *fm = [NSFileManager defaultManager];
No
Or things like this:
NSString *string = [@"~/Desktop/" stringByExpandingTildeInPath];
No
If you called any of the following:
alloc
allocWithZone:
copy
copyWithZone:
new
release
then you are responsible for releasing it, otherwise it's someone
else's responsibility
_______________________________________________
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.