#import "XXOView.h" #import "GridArray.h" #define DEFAULTGRIDCOLOR [NSColor grayColor] #define DEFAULTGRIDSIZE 3 @implementation XXOView - (id)initWithFrame:(NSRect)frameRect { if ((self = [super initWithFrame:frameRect]) != nil) { [self drawGridWithSize:DEFAULTGRIDSIZE inColor:DEFAULTGRIDCOLOR]; gameArray = [[GridArray alloc] initWithWidth:DEFAULTGRIDSIZE]; } return self; } - (void)drawGridWithSize:(int)size inColor:(NSColor*)color { NSPoint p; NSRect r = [self bounds]; float maxHeight = r.size.height, maxWidth = r.size.width; gridSize = size; gridLines = [NSBezierPath new]; [gridLines setLineWidth:0.8]; // Horizontal lines for(int i=1; i