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 3873298
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:01:13+00:00 2026-05-19T22:01:13+00:00

I have already implemented multitouch image rotation using standard iOS graphics library (Core Graphics).

  • 0

I have already implemented multitouch image rotation using standard iOS graphics library (Core Graphics).

It looks like this:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    if ([touches count] == 2) {
        NSArray *twoTouches = [touches allObjects];
        UITouch *first = [twoTouches objectAtIndex:0];
        UITouch *second = [twoTouches objectAtIndex:1];

        CGFloat currentAngle = angleBetweenLinesInRadians([first previousLocationInView:self.view], [second previousLocationInView:self.view], [first locationInView:self.view], [second locationInView:self.view]);

        pic1.transform = CGAffineTransformRotate(pic1.transform, currentAngle);

    }
}

Now I’m trying to implement this solution in my Cocos2d project. First I registered the CCTouchDispacher in my init method.

- (id) init
{
    ...
    [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
    ...
}

In my ccTouchMoved function I changed (UITouch *) to (NSSet *) and built the project just to be sure everything was correct. As a result I got following warning: “Incompatible Objective-C types initializing ‘struct NSSet *’, expected ‘struct UITouch *'”.

As everything still seemed to be working correctly I moved on and tried to extract first and second touch objects from (NSSet *) touch.

- (void)ccTouchMoved:(NSSet *)touch withEvent:(UIEvent *)event {
    if ([touch count] == 2) {
        NSArray *twoTouches = [touch allObjects];
        UITouch *first = [twoTouches objectAtIndex:0];
        UITouch *second = [twoTouches objectAtIndex:1];
    }

}

Now I tried to compile it, which worked, but after I triggered ccTouchMoved through iPhone simulator, I got following error message: “-[UITouch count]: unrecognized selector sent to instance 0x542d6a0′”.

Can somebody please explain, how to get this Cocos2d ccTouchMoved method to recognize and process multitouch events?

Thanks.

  • 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-19T22:01:14+00:00Added an answer on May 19, 2026 at 10:01 pm

    You’ve used wrong CC2D method.

    you should use

    - (BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    

    rather then

    - (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event
    

    as you want to capture multiple touches whereby ccTouchMoved capturs only one

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

Sidebar

Related Questions

I have already implemented some AJAX pagination in my Rails app by using the
I have already implemented and tested the data structure and would now like to
Before I start: I'm programming for Iphone, using objective C. I have already implemented
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I challenge you :) I have a process that someone already implemented. I will
I have already posted something similar here but I would like to ask the
I have already googled for this I have a Table with following structure in
In my previous projects, I have already implemented undo system in c++, and I
My issue is simple. I have already implemented a tab system, and I'd probably
Technically this might not be classed as a programming question, since I have already

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.