Hi,
i want to initialize a 2d array.. but my code doesn`t work,
can somebody tell me what is wrong?
Thanks Chris
@interface Map : NSObject {
int mapData[8][8];
}
@property(readwrite) int** mapData;
@end
@implementation Map
@synthesize **mapData; (Error: Syntax before *)
- (id)initWithMap:(int[8][8])map {
for (int i=0; i<8; i++) {
for (int j=0; j<8; j++) {
self.mapData[i][j] = map[i][j];
}
}
return self;
}
@end
(Warning mapData requires method... use @synthesize or.......)
Edit: if i remove the type at synthesize as suggested, the compiler tells me another error:error type of property mapData does not match type of ivar mapData
Edit#2: can somebody please post the corrected code? i´m working at this really silly problem for over an hour.. (no c/c++ background, but java)