subclassing NSMutableArray
subclassing NSMutableArray
- Subject: subclassing NSMutableArray
- From: Charles Brokaw <email@hidden>
- Date: Sat, 26 Oct 2002 13:00:21 -0700
I must be pretty stupid. I want a subclass of NSArray.
Here is the simplest version of my attempt:
// new Class file: FSArray.h
#import <Cocoa/Cocoa.h>
@interface FSArray : NSArray {
}
+ (FSArray*)array;
@end
// in file FSArray.m
#import "FSArray.h"
@implementation FSArray
+ (FSArray*)array{
self = [super array];
if(!self) return nil;
return self;
}
@end
CALLS;
NSArray* testArray = [NSArray array]; // this works fine
FSArray* test = [FSArray array]; // this fails when it gets to
self = [super array];
Console message upon failure i *** Initialization method -
initWithObjects:count: cannot
be sent to an abstract object of class FSArray: Create a concrete
instance
But I haven't attempted initialization yet ?
Same result if I eliminate my own version of the class method "array"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.