About Archive Tag Cloud Translations RSS

You are writing a comment about Touch Detection in Cocos2d iPhone, here is a quick summary:

A quick look at three different approaches for implementing touch detection using the Cocos2d iPhone library. There are a number of snippets here, and I imagine it would be rather confusing to approach without a basic understanding of ObjC and Cocos2d iPhone.


You are responding to this comment written by Steve on January 4th 2009, 01:01.

Ok.. New problem.. I've completely dumbed down the touch detection to JUST the following method in my layer..

 -(BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@"Touched!");
    return kEventHandled;
}

I've tried with and without backgrounds.. there are no other sprites in the layer.. just a blank layer. In the simulator, this works fine. I get a "Touched!" every time I touch the simulator in my log.. On my iPhone 3G, however, it catches the first touch.. but then hangs there. I can tap to my hearts content but will not see another "Touched!" in my log until I press the home button (at which time, I'll see every "Touched!" I didn't see while the program was running) ... I've been trying to figure this out all night and can't for the life of me. Any ideas?


Please be aware that comment forms go stale after one hour.





Comments may make use of LifeFlow MarkDown. Raw html will be escaped.


Quick Introduction to LifeFlow MarkDown Syntax

A highlighted code block:

@@ ruby
def a (b, c):
  b * c
end
@@

Other common languages work as well: scheme, python, java, html, etc.

Other markdown syntax:

 ### This is an h3 title
#### This is an h4 title
**this is bold**
*this is italics*

1. This is an
2. ordered list

* And an unordered
* list too

[this is a link](http://www.lethain.com/ "Lethain")