I created an application in which I want to use the touchbegan method. For this, I used the following code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSSet *allTouches = [event allTouches];
if([allTouches count] > 0 && self.view!=comparedView.view)
{
ActionViewController *actController = [[ActionViewController alloc] init];
UINavigationController *nvController = [[UINavigationController alloc]
initWithRootViewController:actController];
nvController.navigationBarHidden = YES;
CGRect frame = [[nvController navigationBar] frame];
frame = CGRectMake(0.0,0.0, 320.0, 460.0);
[[nvController navigationBar] setFrame:frame];
[self setView:[nvController view]];
[actController release];
}
}
When you touch anywhere on the screen for my first view, the following code will be executed and it will go to the next view. But the problem is that when I go to the last view and touch the image in this view, the above method is called. I do not understand how this happens, can anyone help me in this situation.
Hi,
Hemant
source
share