• 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
Inheritance from NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Inheritance from NSMutableArray
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: What Happens When a Nib File is Loaded
  • Next by Date: Re: Open GL to Quicktime?
  • Previous by thread: Re: What Happens When a Nib File is Loaded
  • Next by thread: Re: Inheritance from NSMutableArray
  • Index(es):
    • Date
    • Thread