它表示没有错误,但数组中没有任何元素
NSMutableArray *validMoves = [[NSMutableArray alloc]init];
for (int i = 0; i < 100; i++)
{
[validMoves removeAllObjects];
for (TileClass *tilearray in tiles )
{
if ([self blankTile:tilearray] != NONE)
{
[validMoves addObject:tilearray];
}
}
if (validMoves.count > 0)
{
NSInteger pick = arc4random_uniform(validMoves.count);
[self movePiece:(TileClass *)[validMoves objectAtIndex:pick] withAnimation:NO];
}
else
{
NSLog(@"no value");
}
}