Inheritance from NSMutableArray
Inheritance from NSMutableArray
- Subject: Inheritance from NSMutableArray
- From: Felix Schwarz <email@hidden>
- Date: Sun, 15 May 2005 15:44:41 +0200
Hi,
I want to implement a class "MyArray" that adds a couple of methods
on top of what NSMutableArray provides. Right now, however, I don't
need those methods yet but rather want to add them later. So, my code
looks like this currently:
MyArray.m
@implementation MyArray
@end
MyArray.h
@interface MyArray : NSMutableArray
{
}
@end
Now, when I init an instance of MyArray like this:
MyArray *myArr = [[MyArray alloc] init];
and then try to add an object like this:
[myArr addObject:someObject];
I get this error message:
2005-05-15 14:45:11.316 myapp[1630] *** Uncaught exception:
<NSInvalidArgumentException> *** -addObject: only defined for
abstract class. Define -[MyArray addObject:]!
Why is this happening? Why don't I seem to be able to inherit from
NSMutableArray?
Thanks in advance for any hints.
Best regards,
Felix
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden