0

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

2 Answers 2

4

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."

Sign up to request clarification or add additional context in comments.

Comments

2

It's a category, not a subclass. A subclass you would declare as you had, but by compiling with this category, you have altered NSMutableArray itself. So declare it as:

NSMutableArray *tiles;

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.