这是代码:
while((fingerYLast - fingerAt.y) > fingerMoveThresh)
{
if( (activeCard) < (allCardList.count - 2))
{
[self sayOut:@"TRUE"];
activeCard = activeCard + 1;
}
else
{
//WTF????
[self sayOut:[NSString stringWithFormat:@"FALSE %i %i",
activeCard, (allCardList.count - 2)]];
}
fingerYLast -= fingerMoveThresh;
}
我检查了测试值,activeCard 为 -1,allCardList 有 10 个成员。
activeCard = -1;
(activeCard) < (allCardList.count - 2) //evaluates as false
(activeCard+1) < (allCardList.count - 1) //evaluates as true
有任何想法吗?