Article View: chico.ect.help
Article #14Objective C
From: D.A. Harris
Date: Thu, 24 Sep 1998 00:00
Date: Thu, 24 Sep 1998 00:00
30 lines
1529 bytes
1529 bytes
Ok, I'm trying to learn Objective C in a day. Does anyone know the language?
I'm reading through "Object-Oriented Programming and the Objective C
Language" a OpenStep book that Apple now sells. The thing that is
stumping me a little bit is the differance between a class method and
a instance method, maybe I'm just forgetting my OOP terminology, but
Objective C makes a definable differance between the two. So you
have an interface:
@interface MyClass : Object
{
int instance_var;
}
+ foobarClassMethod;
- (BOOL) foobarInstanceMethod;
@end
If you don't have a return type in () specified it returns the id class
type. All classes inherit from Object, like in SmallTalk, unless you
want to make a new root class (probably not a good idea), NeXTStep appears
to use NSObject instead of Object which the GNU compilers use.
So how is the class method used differantly than the instance method?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dale Harris <rodmur@csuchico.edu> PGP KeyID: E26EC5FD
http://www.ecst.csuchico.edu/~rodmur/
|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|
Technical Details
Message-ID:
<6ue3vp$mvd$1@hubble.csuchico.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10fe8a,ee0b22b56dae14e0,start X-Google-Attributes: gid10fe8a,public From: rodmur@ecst.csuchico.edu (D.A. Harris) Subject: Objective C Date: 1998/09/24 Message-ID: <6ue3vp$mvd$1@hubble.csuchico.edu> X-Deja-AN: 394459396 Organization: California State University, Chico Newsgroups: chico.ect.help