Subclass of NSMutableArray isn't working
Subclass of NSMutableArray isn't working
- Subject: Subclass of NSMutableArray isn't working
- From: Jamie Griffin <email@hidden>
- Date: Wed, 10 Mar 2004 00:23:05 -0500
Hi-
I am trying to create a subclass of NSMutableArray called Graph. When I
do so and then call any supposedly inherited method (such as -count), I
get this runtime error:
-count only defined for abstract class. Define -[Graph count]!
If I modify my instantiation of the object from: Graph *thisGraph =
[[Graph alloc]init];
to: Graph *thisGraph = [Graph arrayWithCapacity:1];
the error becomes:
initialization method -initWithCapacity: cannot be sent to an abstract
object of class Graph: Create a concrete instance!
In my understanding of abstract classes, they can be subclassed but not
instantiated. In this case I cannot subclass it but I can instantiate
it.
-Jamie Griffin
"Darmok at Tenagra, Darmok and Gelad on the ocean."
<email@hidden><email@hidden>
_______________________________________________
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.