Touch a problem with the Start method?

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
{
    //Get all the touches.
    NSSet *allTouches = [event allTouches];

    //Number of touches on the screen
    if([allTouches count] > 0 && self.view!=comparedView.view) 
    {
        //Navigate to next screen here likewise you generally do

        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

+3
source share
1 answer

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event will be called each time until the playback controller is released or touch events are disabled.

, touch'

+2

All Articles