<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: cctouchBegan called twice?</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/3749</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 02:02:22 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/3749" rel="self" type="application/rss+xml" />

		<item>
			<title>oscarmk on "cctouchBegan called twice?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3749#post-22520</link>
			<pubDate>Wed, 06 Jan 2010 15:05:02 +0000</pubDate>
			<dc:creator>oscarmk</dc:creator>
			<guid isPermaLink="false">22520@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>That was kinda the case, the problem is that i have an UIScrollView overlaid on top of my cocos Window and therefore receiving the touch events for both the layer and the scrollview. I first though about disabling touches on the scroll over view but that would of course result in not being able to use the scroll view at all...
</p></description>
		</item>
		<item>
			<title>gargantuan on "cctouchBegan called twice?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3749#post-22459</link>
			<pubDate>Tue, 05 Jan 2010 23:45:48 +0000</pubDate>
			<dc:creator>gargantuan</dc:creator>
			<guid isPermaLink="false">22459@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>sounds like you might have two instances. Double check, this happened to me before.
</p></description>
		</item>
		<item>
			<title>oscarmk on "cctouchBegan called twice?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3749#post-22454</link>
			<pubDate>Tue, 05 Jan 2010 22:53:25 +0000</pubDate>
			<dc:creator>oscarmk</dc:creator>
			<guid isPermaLink="false">22454@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I have a Layer subclass that registers itself to receive touches using this method:<br />
-(void) registerWithTouchDispatcher<br />
{<br />
	[[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES];<br />
}</p>
<p>and then I implement my cctouchbegan method as follow:</p>
<p>- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event<br />
{<br />
	NSLog(@"Entered");<br />
	return YES;<br />
}</p>
<p>I have noticed that no matter what I do this always gets called twice. I checked the cocos2d/menu.m and although it appears to do the same ccTouchBegan only gets called once.</p>
<p>Also I don't notice any difference between calling [self registerWithTouchDispatcher] or simply doing isTouchEnabled = YES. What is the difference between this two?. As I understand from posts I have found here the register is the new way to do it, but what does it do different exactly?</p>
<p>I am new to cocos2d and I have been reading posts about the new ways to handle touchs. Where can I find documentation regarding this?. </p>
<p>So why is this getting called twice?. Any help will be greatly appreciated.</p>
<p>Thank you.</p>
<p>-Oscar
</p></description>
		</item>

	</channel>
</rss>

