在我的 IF 语句中,它有点奇怪,因为每次我的代码在其中循环时,只有 SLOT1 被调用并显示在我的调试器中,为什么会这样?我的陈述有问题吗?谢谢。
choiceSlot1 = TRUE;
choiceSlot2 = TRUE;
choiceSlot3 = TRUE;
choiceSlot4 = TRUE;
if (slot1 != [(UIImageView*)[self.carousel1 currentItemView] tag] || twoSlot1 != [(UIImageView*)[self.carousel2 currentItemView] tag] || choiceSlot1 ) {
NSLog(@"Slot1");
choiceSlot1 = FALSE;
}
else if (slot2 != [(UIImageView*)[self.carousel1 currentItemView] tag] || twoSlot2 != [(UIImageView*)[self.carousel2 currentItemView] tag] || choiceSlot2) {
NSLog(@"Slot2");
choiceSlot2 = FALSE;
}
else if (slot3 != [carousel1 indexOfItemViewOrSubview:carousel1.superview] || twoSlot3 != [(UIImageView*)[self.carousel2 currentItemView] tag] || choiceSlot3) {
NSLog(@"Slot3");
choiceSlot3 = FALSE;
}
else if (slot4 != [(UIImageView*)[self.carousel1 currentItemView] tag] || twoSlot4 != [(UIImageView*)[self.carousel2 currentItemView] tag] || choiceSlot4) {
NSLog(@"Slot4");
choiceSlot4 = FALSE;
}