After some research i found a piece of code which shows how to expand NSMutableArray functionality to use 2d arrays easily.
http://www.seattlexcoders.org/shared/Mutable%202D%20Array/
How would my declaration statement of this special NSMutableArray look like?
With the following
#import 'ZNMutable2DArray.h' @interface MainView : UIView { ZNMutable2DArray *tiles; } @property(nonatomic,retain) ZNMutable2DArray *tiles;
It gives me the error ‘syntax error before ZNMutable2DArray..’
Thank you, Chris
ZNMutable2DArray is just a category on NSMutableArray, so you’d declare it as
NSMutableArray *. There’s nothing special about it — the methods are available to all NSMutableArrays. What it does is it creates an NSMutableArray filled with NSMutableArrays, and those are your ‘rows.’