Re: Disposing NSArray
Re: Disposing NSArray
- Subject: Re: Disposing NSArray
- From: Shin Yamamoto <email@hidden>
- Date: Fri, 1 Jun 2001 22:40:49 +0900
On Thu, 31 May 2001 22:04:13 -0700, Vince DeMarco <email@hidden>
wrote:
>
The rules for release, retain , autorelease are simple.
Simple, yes indeed but depending on where you come from, it could be
confusing especially for those who have some C++ experience, myself
included.
In C++'s constructor-destructor paradigm, an object will be destructed
when it goes out of the scope unless created by 'new', whereas an object
will *eventually* released in Obj-C. Now I've got an idea that the
object will be released at the time of next runloop if retain count is
zero, or at least one should assume this. This was somewhat difficult to
grasp because it gave me a wrong impression that the object would be
released at some arbitrary future point. All because I'd mixed up
fundamentally different two languages.
It would be nice if there was brief introductions to Obj-c for C++,
Jave, or whatever it might be, programmers.
shin