[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is +[NSMutableArray initialize] completely implemented?
From: |
Philip Mötteli |
Subject: |
Is +[NSMutableArray initialize] completely implemented? |
Date: |
Sun, 22 Feb 2004 00:49:32 +0100 |
Hi
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.
Re
Phil
- Is +[NSMutableArray initialize] completely implemented?,
Philip Mötteli <=
- Re: Is +[NSMutableArray initialize] completely implemented?, Richard Frith-Macdonald, 2004/02/21
- Re: Is +[NSMutableArray initialize] completely implemented?, Philip Mötteli, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, Richard Frith-Macdonald, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, Philip Mötteli, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, Richard Frith-Macdonald, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, David Ayers, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, Kazunobu Kuriyama, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, David Ayers, 2004/02/22
- Re: Is +[NSMutableArray initialize] completely implemented?, Andrew Pinski, 2004/02/27
- Re: Is +[NSMutableArray initialize] completely implemented?, David Ayers, 2004/02/27