- (void)setToInitialStateMain
{
[super clearBoard];
if (_data[@"StoneOne"] != nil) {
NSDictionary* stoneOne = _data[@"StoneOne"];
NSNumber* c = stoneOne[@"Column"];
NSNumber* r = stoneOne[@"Row"];
NSInteger column = [c intValue];
NSInteger row = [r intValue];
[_boardCol addObject:[NSNumber numberWithInt:column]];
[_boardRow addObject:[NSNumber numberWithInt:row]];
}
}
So the @"StoneOne"
, @"Column"
, and @"Row"
keys are coming from an NSDictionary
plist file. When I try to convert the NSNumber @"Column"
to NSInteger
, everything works ok.
Now, the line [_boardCol addObject:[NSNumber numberWithInt:column]];
is ok in terms of 'column' being the correct integer (2). But, when setup a breakpoint at the end of the method call to examine _boardCol
(as well as _boardRow
), both NSMutableArray*
instance variables are reading nil
. Why is that?