discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSObject - Protocol - Object


From: Helge Hess
Subject: Re: NSObject - Protocol - Object
Date: Wed, 21 Mar 2001 09:49:20 +0100

Michael Scheibler wrote:
> Somehow NSObject is connected with Object (at least in GNU Objective-C).
> NSObject is not only a class but also a protocol and Protocol is derived
> from Object.
> I found out when I tried to implement a method "+ (NSString*)name" in my
> class.
> 
> My question now: is it really preferable that NSObject is not a real root
> class?

There is no such thing like a 'real root class'.

It is of course preferable that libobjc itself uses Object only because
of compatibility to other ObjC compilers and libraries.

BTW: I don't understand your protocol question fully. Only the
reflection object for protocols, 'Protocol', is derived from Object
(it's an libobjc infrastructure object) - NSObject (neither as a class
nor as a protocol) in no way inherits something from Object.

BTW2: If you like you can upgrade the Protocol class to support the
NSObject protocol using a category, say:
@implementation Protocol(NSObject) < NSObject >
...
- (id)retain { return self; }
..
@end

Greetings
  Helge
-- 
SKYRIX Software AG - http://www.skyrix.com/
Visit us at CeBIT: hall 4 / booth E52,(414)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]