RE: Q's about Obj-C
RE: Q's about Obj-C
- Subject: RE: Q's about Obj-C
- From: "Smith, Bradley" <email@hidden>
- Date: Mon, 15 Oct 2001 16:29:44 +0100
Well, fro what little I've learnt from this list: -
1. Correct.
2. Correct
3. Dunno, but be interested to find out
4. You've opened a can of worms here :-) AFAIK you can't have an abstract
class in Obj-C. Someone will probably go to great lengths to tell you why
and attempt to make you feel stupid for even wanting to do it.
Brad
-----Original Message-----
>
From: Joe Chan [mailto:email@hidden]
>
1. When I'm defining the init method for my derived class, I
>
read that I need to deal with [super init] returns nil. It's not
>
entirely clear to me when that happens, who should dealloc the
>
memory of the object? It doesn't seem right to me for the
>
derived classes to deal with it, because if every derived class
>
does it, there will be two many dealloc's chained together. The
>
only place it seems sensible to dealloc is from the actual init
>
method of the class that decides to return nil for some reason.
>
Is that indeed the case?
>
>
2. It's not clear to me when I need to declare a method in the
>
header file. From my reading of the Vermont Recipes at Stepwise,
>
the language does not require me to declare methods in the
>
header file if I override the super's method, or implement a
>
delegate method. Does that mean the only time I need to declare
>
a method in the header is when I introduce a new method to the
>
class?
>
>
3. About the fact that all method of the same name needs to
>
receive the same argument and return types. I'm a little
>
confused by that. Does that apply only to the case of overriding
>
existing method? Say if I have two classes A and B that belongs
>
to different class hierarchies, and they both declare method foo:
<SNIP>
>
4. What makes a class an abstract class? In C++, that's caused
>
by a pure virtual function, but there doesn't seem to an
>
equivalent in Obj-C.