From 1cc97bb19fd5032c18bb52a0ce79d6282c05f6ce Mon Sep 17 00:00:00 2001 From: mccallum Date: Mon, 3 Apr 1995 03:18:43 +0000 Subject: [PATCH] The beginnings for IndexedCollection coexistance. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@238 72102866-910b-0410-8b05-ffd578937521 --- Source/NSArray.m | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Source/NSArray.m b/Source/NSArray.m index 20cc8e69d..d0d7cdec9 100644 --- a/Source/NSArray.m +++ b/Source/NSArray.m @@ -23,14 +23,13 @@ #include #include +#include + +@interface NSArray (libobjects) +@end @implementation NSArray -+ (id) allocWithZone: (NSZone*)zone -{ - return [self alloc]; /* for now, until we get zones. */ -} - + (id) array { return [[[self alloc] init] autorelease]; @@ -55,12 +54,18 @@ return [n autorelease]; } +- (id) initWithCapacity: (unsigned)cap +{ + [self notImplemented:_cmd]; + return self; +} + - (id) initWithArray: (NSArray*)array { int i, c; c = [array count]; - [super initWithCapacity:c]; + [self initWithCapacity:c]; for (i = 0; i < c; i++) [self addObject:[array objectAtIndex:i]]; return self; @@ -109,7 +114,7 @@ #if 0 - (id) lastObject; /* inherited */ -- (id) objectAtIndex: (unsigned)index; +- (id) objectAtIndex: (unsigned)index; /* inherited */ #endif - (NSEnumerator*) objectEnumerator @@ -191,4 +196,10 @@ return nil; } +- (NSString*) description +{ + [self notImplemented:_cmd]; + return nil; +} + @end