discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to initialise an array class inheriting from NSArray?


From: Christopher Culver
Subject: How to initialise an array class inheriting from NSArray?
Date: Wed, 4 Jun 2003 04:40:24 +0300

I've got a class that inherits from NSArray, but don't know how to initialise it. Here's how it looks:

@implementation NewClass : NSArray.

[...]

- (id) init
{
       self  = [super arrayWithObjects: @"String1", @"String2", nil];
       return self;
}

However, when I compile this, gcc reports that "NSArray doesn't respond to arrayWithObjects". How then am I supposed to initalise this subclass?

(And the reason this is a subclass is because I want to use it as a data source for an NSTableView, for which I have to define two extra methods, and this is the only way I know how at the moment. I hear something called "categories" might be useful, but haven't learned about this yet).

Christopher Culver



reply via email to

[Prev in Thread] Current Thread [Next in Thread]