Initialising NSMutableArray
Initialising NSMutableArray
- Subject: Initialising NSMutableArray
- From: DKJ <email@hidden>
- Date: Mon, 13 Jul 2009 08:44:47 -0700
I've subclassed an NSMutableArray, and I want it to be initialised
with some objects already in place. So I did this:
- (id) init
{
self = [super init];
if (self != nil) {
for( int i = 0; i < 3; i++ )
[self addObject:[[[myClass alloc] init] autorelease]];
}
return self;
}
But this produces an NSInvalidArgumentException, with the message:
[NSMutableArray addObject:]: method only defined for abstract
class.
I suspect I'm missing something simple here.
dkj
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden