views:

74

answers:

0

Possible Duplicate:
How to pass double[][] into a method call?

Hi I am trying to init an object with a double value in the format double filter[n][n]; but i keep getting the following error.

in my header i have this

@interface filter : NSObject
{
    double **matrix;
}
@property(nonatomic) double **matrix;
-(id)initWithMatrix:(double**)filterMatrix;

inside my class i have this method.

-(id)initWithMatrix:(double**)filterMatrix
{
    matrix = filterMatrix;
    return self;
}

and i am trying to call it like this.

double filter[3][3] = {0,0,0,0,1,0,0,0,0};
MyMatrix *myMatrix = [[MyMatrix alloc] initWithMatrix:filter];

I now get the error.

Error: Cannot convert double[*][3] to double** in argument passing

Any help on this issue would be amazing. Thanks A