Re: Several questions
Re: Several questions
- Subject: Re: Several questions
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 2 Jul 2001 21:11:36 -0700
On Monday, July 2, 2001, at 06:26 PM, Hisaoki Nishida wrote:
I have some general questions about Cocoa programming.
1. retain and copy: what determines which I should use?
It depends. Retaining an object makes sure that it won't vanish.
Copying an object makes sure that your copy doesn't change unless you
change it.
2. What's the difference between - and + (in method declarations)?
- means an instance method. + means a class method.
3. What's the difference between @class and import? I can't distinguish
their use.
@class simply advises the compiler that the given name is the name of a
class. #import is like C's #include: it means that the compiler should
go and read the given file.
4. When you autorelease something, it ceases to exist when the "event
loop" is finished. What does this mean?
Have a look at Malcolm Crawford's article at stepwise.com,
http://www.stepwise.com/Articles/Technical/2001-03-11.01.html
-jcr
"This is not a book to be tossed aside lightly. Rather, it should be
hurled with great force." -Dorothy Parker