[Top][All Lists]

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

obsolete method and behavior adding

From: Markus Hitter
Subject: obsolete method and behavior adding
Date: Fri, 22 Mar 2002 14:18:20 +0100

Hello all,

here's a issue, I'm not too sure about.

In NSArray.m I see:

@implementation NSArray
+ (id) allocWithZone: (NSZone*)z {
  if (self == NSArrayClass) {
    } else {  // != NSArrayClass, e.g. GSArrayClass
      return NSAllocateObject(self, 0, z);

In GSArray.m, something similar:

@interface GSArray : NSArray

@implementation GSArray
+ (id) allocWithZone: (NSZone*)zone
  GSArray       *array = NSAllocateObject(self, 0, zone);

  return array;

To all of my knowledge, the first implementation makes the second obsolete?

The reason I came across such an issue is, on NeXT runtime behavior_class_add_class() makes major trouble. A possible conclusion might be, we have to get rid of behavior adding on NeXT runtime, at least in +initialize methods.

In all occurences of behavior_class_add_class(), some GS* class is involved. I'm trying to find out why all these GS* classes exist.

Is it OK to consider behavior adding as some sort of multiple inheritance trough the backdoor?


- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter

reply via email to

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