Re: OOP Clarification
Re: OOP Clarification
- Subject: Re: OOP Clarification
- From: Charles Srstka <email@hidden>
- Date: Tue, 1 Jan 2002 03:58:39 -0600
The way I understood it, a class method did have a reference to 'self',
but that reference would point to the class. In other words, you could
have a [[self alloc] init] in a class method, and it would make a new
instance of that class.
I could be mixed up, though...
On Monday, December 31, 2001, at 11:34 PM, Adam Eijdenberg wrote:
I've read about the difference between a class method and a instance
method
before, but the difference has somehow become lost in my cobwebs. All
I can
remember is the difference is subtle, but an important concept.
A class method applies to the the entire class, rather than an
individual instance. That is, a class method has no reference to 'self'
(or 'this' depending on the language used). Basically it's just a
method that logically should be with the class definition, but isn't a
true "method" as such that it applies to an object, it's more like a
"function" in procedural programming.
Hope that helps.
Kind regards,
Adam Eijdenberg
_______________________________________________
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.