• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Mysteries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: Memory Mysteries
      • From: Ben Dougall <email@hidden>
References: 
 >Memory Mysteries (From: email@hidden)

  • Prev by Date: Re: Forum for advanced Cocoa questions
  • Next by Date: Re: Localize in Japanese?
  • Previous by thread: Memory Mysteries
  • Next by thread: Re: Memory Mysteries
  • Index(es):
    • Date
    • Thread