Re: Seemingly ridiculous problem...
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.