I am working with C style 2d arrays of integers.
This is fine in my main class file, and I can pass my arrays by reference to other classes. I have run into issues when I try to retrieve a pointer to the arrays and work with that.
My question is: rather than using C style 2d arrays, is there a better way to do it? maybe a Cocoa class I don't know about? I noticed NSMatrix, but that seems geared for cells, rather than plain ints.
I've got calls all over the place in this format: items[x][y], so a shorthand way of referencing array positions would be great.
Further details:
I set up the arrays as instance variables, and tried to access like this:
-(void) setItems: (int [15][24])items { (*pitems)[24] = **items; }
-(int) getItems { return (*pitems)[24]; }
When I tried to retrieve using getItems, I was getting compiler warnings about creating a reference without a cast.