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

subclassing NSMutableArray


  • Subject: subclassing NSMutableArray
  • From: Charles Brokaw <email@hidden>
  • Date: Sat, 26 Oct 2002 13:00:21 -0700

I must be pretty stupid. I want a subclass of NSArray.
Here is the simplest version of my attempt:

// new Class file: FSArray.h

#import <Cocoa/Cocoa.h>


@interface FSArray : NSArray {

}
+ (FSArray*)array;

@end

// in file FSArray.m

#import "FSArray.h"


@implementation FSArray
+ (FSArray*)array{
self = [super array];
if(!self) return nil;
return self;
}

@end

CALLS;

NSArray* testArray = [NSArray array]; // this works fine

FSArray* test = [FSArray array]; // this fails when it gets to self = [super array];

Console message upon failure i *** Initialization method - initWithObjects:count: cannot
be sent to an abstract object of class FSArray: Create a concrete instance

But I haven't attempted initialization yet ?

Same result if I eliminate my own version of the class method "array"
_______________________________________________
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: subclassing NSMutableArray
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: drawers closes, but is visible
  • Next by Date: Re: subclassing NSMutableArray
  • Previous by thread: Re: Follow-up: Cocoa-Java Threads
  • Next by thread: Re: subclassing NSMutableArray
  • Index(es):
    • Date
    • Thread