I've found this strangest behavior with touch event. The targeting view is not even allocated yet touchesEnded will get called by tapping any part of the screen with 2 fingers not 1, must be 2... then it skips touchesBegan, call touchesEnded. I even checked if the targeted view's userInteraction is set to YES but no, it's set to NO obviously cuz it's NO by default but it's not allocated anyway.
All this does not happen when the targeted view is already allocated and positioned etc.
Has anyone experienced this?? Why does this happen and do I must allocate the property in order to prevent its touch events getting called randomly like crazy? Also why would this strange behavior require 2 fingers at the same time instead of just one tap.... it's not important but I'm just very curious.
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [[event allTouches] anyObject];
if (touch.view == self.buttonStartButton) {
NSInteger levelUp = [self.levelModel checkForLevelUp];
if (levelUp == 0) {
[self byeGameContainer];
}
else {
[self.delegate levelingUp];
}
}}