I'm trying to track down a strange exception, that I never had before
the last CVS update:
: Uncaught exception NSGenericException, reason: subclass
NSMutableArray(instance) should override initWithCapacity:
The backtrace, that leads to that is the following:
+[NSException raise:format:arguments:]
+[NSException raise:format:]
-[NSObject(GSCategories) subclassResponsibility:]
-[NSMutableArray initWithCapacity:]
-[NSMutableArray initWithObjects:count:]
-[NSArray init]
-[EDStack init]
+[EDStack stack]
So all happens during a very early phase of the program. Most classes
haven't been called once yet.
I'm not sure, but I have the impression, that the problem could
perhaps be situated here:
@implementation NSMutableArray
+ (void) initialize
{
if (self == [NSMutableArray class])
{
}
}
+ (id) allocWithZone: (NSZone*)z
{
if (self == NSMutableArrayClass)
{
return NSAllocateObject(GSMutableArrayClass, 0, z);
}
else
{
return NSAllocateObject(self, 0, z);
}
}
...
Shouldn't there be some more code in + initialize? Because in the
debugger the variable NSMutableArrayClass is been shown as having the
value nil.
Probably, the problem is because +[NSArray initialize] has not yet
been called, is it? There should be a mechanisme, that assures that
or that initializes the same data.