• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclass of NSMutableArray isn't working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Subclass of NSMutableArray isn't working
      • From: "Louis C. Sacha" <email@hidden>
    • Conversion from an absolute URL to relative
      • From: Satoshi Matsumoto <email@hidden>
  • Prev by Date: Apple Help Viewer
  • Next by Date: Conversion from an absolute URL to relative
  • Previous by thread: Re: Apple Help Viewer
  • Next by thread: Conversion from an absolute URL to relative
  • Index(es):
    • Date
    • Thread