Re: about memory
Re: about memory
- Subject: Re: about memory
- From: Ondra Cada <email@hidden>
- Date: Thu, 25 Jul 2002 16:19:35 +0200
On Thursday, July 25, 2002, at 05:23 , Chong Hiu Pun wrote:
In using NSOpenPanel, do we need to call alloc and dealloc?
Nope. As for dealloc, but for the [super dealloc] in dealloc itself, you
NEVER EVER call it.
NSOpenPanel *panel = [[NSOpenPanel alloc] init]
Wrong.
panel = [NSOpenPanel openPanel];
Right.
[NSOpenPanel dealloc]
Very very definitely wrong. Not only you never ever send dealloc
explicitly; also, you don't send (in this context) message to a class, but
to the instance.
NSOpenPanel *panel = [NSOpenPanel openPanel];
That's it.
Thank you very much ( as my concept on cocoa memory management is not so
good
Why not reading the docs, and perhaps some of those so many articles on
Stepwise?
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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: | |
| >about memory (From: "Chong Hiu Pun" <email@hidden>) |