Re: Class Methods & Class Objects?
Re: Class Methods & Class Objects?
- Subject: Re: Class Methods & Class Objects?
- From: Chris Gehlker <email@hidden>
- Date: Mon, 20 Aug 2001 18:23:57 -0700
On 8/20/01 5:18 PM, "James Bredijk" <email@hidden> wrote:
>
Hi,
>
As a Cocoa newbie, I'm a little confused with "class methods" &
>
"class objects". Could someone explain what these things do as
>
apposed to instance methods & instance objects??
If you are coming from C++ or Java, a class method is the same idea as a
static method. If fact C++ people often call static methods "class methods".
A class object is an actual object that represents the class, rather than
any instance of the class, so it has no instance variables.
Often convenience allocators, which allocate an outoreleased instance of the
class, are class methods.
If you are coming from C, may be a little harder to grasp the distinction.
Be sure to read ObjC.pdf and then ask again if it's not clear.
--
Tact is the ability to describe others as they see themselves. -Abraham
Lincoln, 16th president of the U.S (1809-1865)