В моем описании IF, его странном, вызывающем, каждый раз, когда мой код обходит его, только SLOT1 вызывается и отображается в моем отладчике, почему это так? Что-то не так с моим заявлением? Благодарю.Оператор IF, сравнивающий
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;
}
Ну, вы выбираете choiceSlot1 как истину каждый раз, поэтому он всегда входит в первую, если. – borrrden
'choiceSlot1' всегда TRUE .. – Kjuly
Что делать для остальной части оператора if, который вызывается? – Bazinga