Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:09:44+00:00 2026-05-31T00:09:44+00:00

In my app delegate, I made sure I have the line: [glView setMultipleTouchEnabled: YES];

  • 0

In my app delegate, I made sure I have the line:

    [glView setMultipleTouchEnabled: YES];

And I have a simple layer meant only to figure out how multi touch works. The .mm file looks like:

#import "TestLayer.h"

@implementation TestLayer
-(id) init
{
    if( (self=[super init])) {
        [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
    }
    return self;
}

-(void) draw{
     [super draw];
    glColor4f(1.0, 0.0, 0.0, 0.35);
    glLineWidth(6.0f);
    ccDrawCircle(ccp(500,500), 250,CC_DEGREES_TO_RADIANS(360), 60,YES);

}

-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"got some touches");
}

-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"some touches moved.");
}

-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
    NSLog(@"a touch began");
    return FALSE;
}
@end

When I touch the screen, I always see “a touch began”, but no matter how I touch it (simulator or actual device), I never see “some touches moved” or “got some touches”.

Is there something further I need to do to make multi touch work?

Specifically, I’m just trying to do basic pinch-to-zoom functionality… I heard there is some sort of gesture recognizer for iPhone…does it work for Coco2ds? Would it work even if I can’t get simple multi touch events to fire?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:09:46+00:00Added an answer on May 31, 2026 at 12:09 am

    UIGestureRecognizers absolutely work for Cocos2D, I personally used them, you just need to add them to the correct view by using:

    [[[CCDirector sharedDirector] openGLView] addGestureRecognizer:myGestureRecognizer];
    

    Regarding your touches, I guess you enabled them for the scene you are working in?

    scene.isTouchEnabled = YES;
    

    In any case you shouldn’t use the addTargetDelegate method, take a look here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Cocoa application where I have an auto generated app delegate:(MyAppDelegate.h/MyAppDelegate.m) So
It sure looks innocuous enough. In my App Delegate, I check NSUserDefaults for a
I want to show the intro nib i made only at first app launch.
In my app I am using CLLocationManager and AdWhirl. I have made no specific
I have a very basic iphone app where the following steps occur. App Delegate
I have in my App Delegate an NSArray that contains a range of LPProduct
I have made a Tab Bar app and have added a UIPickerView in the
I have made an app that implements the iPhone's camera. When the user finishes
I am working on a simple iOS app that I have taken over at
Here is my code stub for my app-delegate.m -- it never gets called. -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.