• 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: Seemingly ridiculous problem...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seemingly ridiculous problem...


  • Subject: Re: Seemingly ridiculous problem...
  • From: Sam Goldman <email@hidden>
  • Date: Thu, 14 Feb 2002 01:13:09 -0800

I forgot one thing, memory management.

The solution I gave would give you a retained object. Objective-C doesn't
have garbage collection so you have to get it out of memory manually.

To do this, make sure that when you are done with the image you call this:
[pointer release].

Some methods return autoreleased objects. Actually most do, but alloc, new,
and I know there's another one that I am forgetting. Since you call alloc to
create an instance of the class, which returns a retained object, you have
to release it. If you called a method like NSString's stringWithString:,
which returns an autorelease object, it would be released along with the
autorelease pool.

I don't want to get too involved with this topic since it is very *VERY*
well documented (by apple and others) and I will probably make (and already
might have made) a mistake.

- Sam
_______________________________________________
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.

References: 
 >Seemingly ridiculous problem... (From: Kigney <email@hidden>)

  • Prev by Date: Re: Seemingly ridiculous problem...
  • Next by Date: Re: preventing delivery of Signals.
  • Previous by thread: Re: Seemingly ridiculous problem...
  • Next by thread: Re: Anyone here written a kExt???
  • Index(es):
    • Date
    • Thread