Touches become unresponsive after using iOS UI elements

Touches become unresponsive after using iOS UI elements
0.0 0


After running my app for a while I lose response to touch input and the following message spams my log on each touch.

Cocos2d: if the index doesn't exist, it is an error
Cocos2d: touchesEnded or touchesCancel: count = 0
Cocos2d: The touches is more than MAX_TOUCHES, nUnusedIndex = -1

It seems to occur after two unrelated pats of the app. Going back and forth a few times between my main menu and game scene (with a video in between) and taking a picture with the camera. The only correlation is that both those parts of the app use iOS UI objects. I’ve included some of the current iteration of my video playing code below.

- (void) playIntroVideo:(NSNotification*)notification {

    NSString* location  = [[NSBundle mainBundle] pathForResource:@"introVideo" ofType:@"mp4"];
    NSURL* vidURL       = [NSURL fileURLWithPath:location];
    _movie              = [[MPMoviePlayerController alloc] initWithContentURL:vidURL];

    _movie.controlStyle = MPMovieControlStyleNone;
    _movie.view.frame   = mainView.bounds;  = CGPointMake(mainView.bounds.size.width / 2, mainView.bounds.size.height / 2);

    [__glView addSubview:_movie.view];

    UITapGestureRecognizer* tapChecker  = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(videoWasTapped:)];
    tapChecker.numberOfTapsRequired     = 1;

    UIView* tapView = [[UIView alloc] initWithFrame:mainView.bounds];
    [tapView addGestureRecognizer:tapChecker];
    [_movie.view addSubview:tapView];

    [[NSNotificationCenter defaultCenter] addObserver:self

    [_movie play];

- (void) videoDidFinish:(NSNotification*)notification {

    [[NSNotificationCenter defaultCenter] removeObserver:self

    [_movie stop];

    [_movie.view removeFromSuperview];
    [_movie release];
    _movie = nil;

- (void) videoWasTapped:(UITapGestureRecognizer*)sender {
    [self videoDidFinish:nil];

The problem seems to occur after roughly 6 video plays and an indeterminate amount of uses of the camera.


Same problem,

App not accepting any touches after clicking a iAd Ad