I’ve tried code as below, but nothing works:
public class TestClass : Foundation.NSMutableArray{
public static void test(){
var t1 = new TestClass();
// #1 Terminating app due to uncaught exception 'NSInvalidArgumentException',
// reason: '*** -[NSArray count]: method only defined for abstract class. Define -[TestClass count]!'
t1.doSth();
// #2 Terminating app due to uncaught exception 'NSInvalidArgumentException',
// reason: '*** -[NSMutableArray initWithCapacity:]: method only defined for abstract class. Define -[TestClass initWithCapacity:]!'
var t2 = new TestClass withCapacity(4);
var t3 = new TestClass(4);
}
public TestClass(){
}
public TestClass(int capacity)
{
// FAILED as #2
base.initWithCapacity(capacity);
}
/*
public TestClass(int capacity)
// FAILED as #2
: base withCapacity(capacity)
{
}
*/
public int doSth(){
return base.count - 1;
}
}