Hi, this is a bit of a newbie question but I can't seem to find it anywhere. I have defined a class in a set of .h/.m files and have a separate .h/.m for drawing. What I'm trying to do is create an array of objects from this class, and draw them sequentially to the screen.
Of course, I'm getting a 'squares' undeclared (first use in this function)
error. I went around in circles for a while, with lots of duplicate code, before I admitted that I don't know how to do this and went to seek help here.
In one .h file:
@interface DrawerViewController : UIViewController {
NSMutableArray *squares;
}
@property (nonatomic, retain) NSMutableArray *squares;
@end
In the corresponding .m:
squares = [[NSMutableArray alloc] init];
In another .m file, where I want to access the "squares" array:
if ([squares objectAtIndex:thisID] != NULL) {
And that's where I'm getting the error: "squares" undeclared.
I'm using include
to bring in the other .h file, but that doesn't seem to be working.
If someone can point me in the right direction, I will be very grateful...