Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RutgerB

macrumors member
Original poster
Jul 13, 2008
32
1
Hi

I have a class called GameLogic and I want it to have an instance variable that is a 2D array of integers.

So I use this code:

In the .h file:
Code:
@interface GameLogic : UIViewController {
    int board[4];
}
@property int board[4];

And then in the .m file:
Code:
synthesize board[4][4];

This gives a lot of errors..

So I want to know how to add a 2D array as an instance variable to a class.


Thanks
Rutger
 
synthesize should have a '@' in front of it and you can only synthesize something as it's been declared. Also does the properties/synthesize mechanism work for c array?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.