gar*_*hdn 0 arrays boolean objective-c ios
我在初始化一系列bool时遇到了很多问题.当使用NSLog我不断得到(null).我正在尝试设置piecesInPlace40个NO的可变数组.我试图改变setupArrayWithFalses以YES用于测试目的,并仍然得到(null).
BOOL setupArrayWithFalses = NO;
for (int i=0; i<40; i++) {
[piecesInPlace addObject:[NSNumber numberWithBool:setupArrayWithFalses]];
}
NSLog(@"Value of object: %@", [piecesInPlace objectAtIndex:0]);
Run Code Online (Sandbox Code Playgroud)