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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to