<?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: Program recives signal EXC_BAD_ACCESS</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/8223</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:40:10 +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/8223" rel="self" type="application/rss+xml" />

		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48346</link>
			<pubDate>Thu, 29 Jul 2010 20:00:18 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48346@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>aaaaahhhhhhh, i have now understood why it is happening. the statement is returning a false value, so it is trying to loop through an extra body, of which there isn't. So, i now need to figure out how to get the position of the ball on the map, and use TestPont on the map properly.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48340</link>
			<pubDate>Thu, 29 Jul 2010 19:36:05 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48340@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>ahah, i found out where it is crashing.<br />
<code>if (b-&#62;GetPosition().y &#62; 0 &#38;&#38; b-&#62;GetPosition().x &#60; throwWidth)</code></p>
<p>the thing is, i have no idea why. They all seem like valid statements to me</p>
<p>update: it actually is the case that if the ball is off of the original position of the screen the loop occurs a third time. I will try a different condition, but i have no idea why this happens.
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48339</link>
			<pubDate>Thu, 29 Jul 2010 19:33:43 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">48339@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>sorry, I haven't used Box2D so I can't help you with that one :(
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48328</link>
			<pubDate>Thu, 29 Jul 2010 18:31:23 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48328@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>It's seems like the ball loses it's fixture when it goes of the bottom of the screen, but is still able to be part of all the physics.... i don't get it.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48327</link>
			<pubDate>Thu, 29 Jul 2010 18:25:39 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48327@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>it might be passing the coordinates of the bodies in the b2world. the thing is though, i have no idea why it would crash with the earlier method that i was using, where i think the positions were taken from the ones on the screen. I think i will have to do a bit of research on the body positions, and try to find out why the old one was crashing.
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48319</link>
			<pubDate>Thu, 29 Jul 2010 17:54:17 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">48319@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hmm.. what type of coordinates did you pass? this is supposed to work with the screen coordinates (i.e. 0,0 to 320,480). It might be that the coordinates that you are passing are from your physics world.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48282</link>
			<pubDate>Thu, 29 Jul 2010 13:49:26 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48282@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>errr, slight problem, i used your function and then i logged the coordinates of the ball. i got 0, 1073741824</p>
<p>that is definately wrong could you explain how it works, it is probably something in my code
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48265</link>
			<pubDate>Thu, 29 Jul 2010 10:48:24 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48265@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i failed, to put it simply. I am afraid that i will need your help. Sorry
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48180</link>
			<pubDate>Wed, 28 Jul 2010 20:16:01 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48180@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thanks, the crash is fixed now, but i the ball is not being moved, because TestPoint isn't taking the position on the map, it is taking the point that the others used to take. I will take a look at the code of TestPoint and see if i can change it, but i don't think i can do much, i'm afraid that i might need your help again
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48170</link>
			<pubDate>Wed, 28 Jul 2010 18:50:00 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">48170@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well, i'm not sure how to fix your crash to be honest :) But if there's still any value to it, here's how you convert a position in 2D space into a TMX tile coordinate:</p>
<pre><code>- (CGPoint)tileCoordForPosition:(CGPoint)position {
    int x = position.x / _tileMap.tileSize.width;
    int y = ((_tileMap.mapSize.height * _tileMap.tileSize.height) - position.y) / _tileMap.tileSize.height;
    return ccp(x, y);
}</code></pre>
<p>This should help you figure out the position of your ball in terms of the TMX tilemap coordinate.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48150</link>
			<pubDate>Wed, 28 Jul 2010 14:58:07 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48150@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have fixed it, sort of. I added this line in after i++. <code>f = b-&#62;GetFixtureList();</code></p>
<p>Now it only crashes when the centre of the ball is off the screen. I think that this can be fixed of i know how to get the position of the ball in the CCTMXTIledMap, and not on the screen. One problem, i don't know how to do that.... Is there a way that i could do that?</p>
<p>Thanks so much to lordbritishix and riq, you guys are geniuses, thanks for all of the help.</p>
<p>Update:I have just done some testing, and off the screen os not strictly true..... It seems that it will crash if it is not in the bounds of the original position of the screen
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48069</link>
			<pubDate>Tue, 27 Jul 2010 23:49:58 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48069@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>here is the traceback, thanks fro the quick reply.<br />
<pre><code>#0  0x000064d3 in b2Fixture::TestPoint (this=0x28385be, p=@0xbfffd43c) at b2Fixture.h:307
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>  0x00005768 in -[Level ccTouchesBegan:withEvent:] (self=0x646f2b0, _cmd=0xb0f48, touches=0x78de100, event=0x64126a0) at /Users/Daniel/Programs/iPhone apps/FingerSmash Beta 2.0/Classes/Level.mm:76
#<a href='http://www.cocos2d-iphone.org/forum/tags/2'>2</a>  0x000977b3 in -[CCTouchDispatcher touches:withEvent:withTouchType:] (self=0x6425c40, _cmd=0xb92e1, touches=0x78de100, event=0x64126a0, idx=0) at /Users/Daniel/Programs/iPhone apps/FingerSmash Beta 2.0/libs/cocos2d/CCTouchDispatcher.m:252
#<a href='http://www.cocos2d-iphone.org/forum/tags/3'>3</a>  0x00097ce2 in -[CCTouchDispatcher touchesBegan:withEvent:] (self=0x6425c40, _cmd=0xb9f46, touches=0x78de100, event=0x64126a0) at /Users/Daniel/Programs/iPhone apps/FingerSmash Beta 2.0/libs/cocos2d/CCTouchDispatcher.m:289
#<a href='http://www.cocos2d-iphone.org/forum/tags/4'>4</a>  0x0009fbe1 in -[EAGLView touchesBegan:withEvent:] (self=0x6420c20, _cmd=0xb9f46, touches=0x78de100, event=0x64126a0) at /Users/Daniel/Programs/iPhone apps/FingerSmash Beta 2.0/libs/cocos2d/Support/EAGLView.m:290
#<a href='http://www.cocos2d-iphone.org/forum/tags/5'>5</a>  0x00833253 in -[UIWindow _sendTouchesForEvent:] ()
#6  0x008151ec in -[UIApplication sendEvent:] ()
#7  0x00819ac4 in _UIApplicationHandleEvent ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/8'>8</a>  0x03dbdafa in PurpleEventCallback ()
#9  0x028fedc4 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>0 0x0285f737 in __CFRunLoopDoSource1 ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>1 0x0285c9c3 in __CFRunLoopRun ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>2 0x0285c280 in CFRunLoopRunSpecific ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>3 0x0285c1a1 in CFRunLoopRunInMode ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>4 0x03dbc2c8 in GSEventRunModal ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>5 0x03dbc38d in GSEventRun ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>6 0x0081db58 in UIApplicationMain ()
#<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>7 0x00002890 in main (argc=1, argv=0xbfffef2c) at /Users/Daniel/Programs/iPhone apps/FingerSmash Beta 2.0/main.m:13
Current language:  auto; currently objective-c++
Warning: the current language does not match this frame.</code></pre></description>
		</item>
		<item>
			<title>riq on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48059</link>
			<pubDate>Tue, 27 Jul 2010 21:04:50 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">48059@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Could you post the traceback ?</p>
<p>Once it crashes open the Xcode debugger console, and type "bt"<br />
<pre><code>(gbd) bt</code></pre>
<p>Please, post the traceback between backticks (`). thanks.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48050</link>
			<pubDate>Tue, 27 Jul 2010 19:36:47 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48050@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thanks yet again to lord britishix, but because of a few complications i am afraid that i cannot do that. but i have made some changes, i'm afraid that i still need some help. I should probably have mentioned that i am using a CCTMXTiledMap. Here is the new code:<br />
<pre><code>-(BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
	if (mouseJoint != NULL) return NO;
	NSSet *allTouches = [event allTouches];
	UITouch *touch = [touches anyObject];
	CGPoint touchLocation = [touch locationInView: [touch view]];
	touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
	if ([allTouches count] == 1) {
		b2Vec2 locationWorld = b2Vec2(touchLocation.x, touchLocation.y);
		if (touchLocation.x &#60; throwWidth) {
			b2Fixture *f;

			int i = 0;
			for (b2Body *b = world-&#62;GetBodyList(); i&#60;noOfBalls; b = b-&#62;GetNext(), f = b-&#62;GetFixtureList()) {
				NSLog(@&#34;Point 1 reached&#34;); //THIS POINT IS STILL REACHED TWICE IF THE BALL IS NOT ON THE SCREEN, BUT STILL ON THE MAP, IF THE BALL IS ON THE SCREEN IT IS REACHED ONCE BEFORE THE CRASH
				if (b-&#62;GetPosition().y &#62; 0 &#38;&#38; b-&#62;GetPosition().x &#60; throwWidth) { //THIS MEANS THAT THE BODY IS NOT THE GROUND BODY, AS THAT HAS A Y LOCATION OF 0, AND THAT BALL IS THROWABLE (IT CAN ONLY BE THROWN IF IT BEHIND A LINE THAT HAS A X VALUE OF THE THROW WIDTH).
					i++;
					NSLog(@&#34;Point 2 reached&#34;); THIS POINT IS ONLY REACHED IF THE BALL IS ON THE SCREEN
					if (f-&#62;TestPoint(locationWorld)) {
						NSLog(@&#34;Point 3 reached&#34;); //THIS POINT IS NEVER REACHED
						bod = b;
						mouseJointDef.bodyA = groundBody;
						mouseJointDef.bodyB = bod;
						mouseJointDef.target = locationWorld;
						mouseJointDef.collideConnected = true;
						mouseJointDef.maxForce = 1000000.0f * bod-&#62;GetMass();
						mouseJoint = (b2MouseJoint *)world-&#62;CreateJoint(&#38;mouseJointDef);
						bod-&#62;SetAwake(true);
						break;
					}
				}
			}
		}

	}

	return YES;
}</code></pre>
<p>The debugger shows me this if the ball is on the screen:<br />
<pre><code>inline bool b2Fixture::TestPoint(const b2Vec2&#38; p) const
{
return m_shape-&#62;TestPoint(m_body-&#62;GetTransform(), p); //THIS LINE IS HIGHLIGHTED
}</code></pre>
<p>I guess that one of the things that i need to know is how to get the position of the body in the map not the screen, i still get the EXC_BAD_ACCESS error with the test point btw<br />
Please can you help, i am sorry for my idiocy, thankyou so much
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48033</link>
			<pubDate>Tue, 27 Jul 2010 17:29:34 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">48033@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>got confused with your complex loop :) if all you need to do is to do detect if the ball has been touched (I don't like the sound of that) and if you've added the balls inside your fixture list, then you can just iterate through your fixture list (and not the ball array at the same time) but every iteration, check if the class is a ball like so:</p>
<pre><code>if ([fixtureItem isKindOfClass:[Ball class])
{
   //do specific items to the ball
   ..
}</code></pre>
<p>Cheers!
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-48018</link>
			<pubDate>Tue, 27 Jul 2010 13:45:31 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">48018@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well my plan was to create an NSMutable array of all of the bodies, which doesn't work unfortunately, if somebody has any ideas, please could they help, all of the posts are much appreciated
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47975</link>
			<pubDate>Tue, 27 Jul 2010 09:09:59 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">47975@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thanks again lordbritishix, but this time i am afraid that it didn't work. I have realised that the NSLog(@"Point 1 reached") statement is called twice, while i only have one ball in the ball array. This is because i am using world-&#62;GetFixtureList, which will include the body i used to represent the ground, which is not in the ball array. As i am using b; as my parameter, it will be able to loop through twice, and as there is only one object in the ballArray, i am trying to execute this: [ballArray objectAtIndex:1];, which does not exist. I am fairly sure that that is the problem, and i will try fix it, but because i am not very good, any help would be more than welcome.</p>
<p>Thanks again to lordbritishix fro reading through all of that code.
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47929</link>
			<pubDate>Mon, 26 Jul 2010 23:34:31 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">47929@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hmm, I haven't used Box2D yet but I was wondering if the statement:</p>
<p>'<br />
mouseJoint = (b2MouseJoint *)world-&#62;CreateJoint(&#38;mouseJointDef);<br />
'</p>
<p>inside your ccTouchesBegan actually modifies the b2Body array that you are currently iterating. Try commenting it out to see if it will work.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47908</link>
			<pubDate>Mon, 26 Jul 2010 20:26:05 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">47908@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thanks so much lordbritishix, that fixed in five minutes, and sorry to riq.</p>
<p>I now have another problem, yet again EXC_BAD_ACCESS, but now zombies is returning nothing. I am using cocos2d 0.99.1 on the simulator running iOS 4.</p>
<p>the error only happens when ccTouchesBegan is called from inside the level class, at a certain (code included below and the point is commented).<br />
<pre><code>inline b2Fixture* b2Body::GetFixtureList()
{
	return m_fixtureList; // THIS IS HIGHLIGHTED IN THE DEBUGGER
}</code></pre>
<p>Here is the init method inside level.mm:<br />
<pre><code>-(id)initWithWorld:(b2World *)worl ThrowableArea:(int)throwableWidth Gravity: (float)gx : (float)gy{
	if ((self = [super init])) {
		throwWidth = throwableWidth;
		self.isTouchEnabled = TRUE;
		b2Vec2 grav = b2Vec2(gx, gy);
		worl = new b2World(grav, true);
		world = worl;
		boundaryLine = [CCSprite spriteWithFile:@&#34;Line.png&#34;];
		boundaryLine.position = ccp(throwableWidth, -310);
		map = [CCTMXTiledMap tiledMapWithTMXFile:@&#34;TheMap.tmx&#34;];
		[self addChild:map z:-1 tag:kTagBackground];
		[map addChild: boundaryLine];

		groundBodyDef.position.Set(0,0);
		groundBody = world-&#62;CreateBody(&#38;groundBodyDef);
		boxShapeDef.shape = &#38;groundBox;
		groundBox.SetAsEdge(b2Vec2(map.position.x - (map.contentSize.width/2),(map.position.y - (map.contentSize.height/2))), b2Vec2(map.contentSize.width, (map.position.x - (map.contentSize.width/2))));
		groundBody-&#62;CreateFixture(&#38;boxShapeDef);
		groundBox.SetAsEdge(b2Vec2(0, map.contentSize.height), b2Vec2(map.contentSize.width, map.contentSize.height));
		groundBody-&#62;CreateFixture(&#38;boxShapeDef);
		groundBox.SetAsEdge(b2Vec2(map.contentSize.width, map.contentSize.height), b2Vec2(map.contentSize.width, 0));
		groundBody-&#62;CreateFixture(&#38;boxShapeDef);
		[self schedule:@selector(tick:)];
		gx = nil;
		gy = nil;
		throwableWidth = nil;
		worl = nil;
	}
	return self;
}</code></pre>
<p>and here is the ccTouchesBegan method inside level.mm that is making the app crash:<br />
<pre><code>-(BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
	if (mouseJoint != NULL) return NO;
	NSSet *allTouches = [event allTouches];
	UITouch *touch = [touches anyObject];
	CGPoint touchLocation = [touch locationInView: [touch view]];
	touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];
	if ([allTouches count] == 1) { //THE PROBLEM IS CAUSED BY ONE TOUCH THAT HAS A POSITION ON THE X AXIS LESS THAN THE        THROW WIDTH
		b2Vec2 locationWorld = b2Vec2(touchLocation.x, touchLocation.y);
		if (touchLocation.x &#60; throwWidth) {
			b2Fixture *f;
			b2Body *b = world-&#62;GetBodyList();
			int i = 0;
			for (CCSprite *s = [ballArray objectAtIndex:i]; b; b = b-&#62;GetNext(), f = b-&#62;GetFixtureList(), i++) { //I AM TRYING TO LOOP THROUGH ALL THE BALLS IN THE LEVEL (ALL IN BALLARRAY) AND FIND OUT IF THE TOUCH IS IN THEM
				NSLog(@&#34;Point 1 reached&#34;);
				if (CGRectContainsPoint(s.textureRect ,CGPointMake(locationWorld.x, locationWorld.y))) {
					NSLog(@&#34;Point 2 reached&#34;);

					mouseJointDef.bodyA = groundBody;
					mouseJointDef.bodyB = bod;
					mouseJointDef.target = locationWorld;
					mouseJointDef.collideConnected = true;
					mouseJointDef.maxForce = 1000000.0f * bod-&#62;GetMass();
					mouseJoint = (b2MouseJoint *)world-&#62;CreateJoint(&#38;mouseJointDef);
					bod-&#62;SetAwake(true);
					break;
				}
			}
		}

	}

	return YES;
}</code></pre>
<p>The code in tutorial.mm (which i am using as a test level):<br />
<pre><code>-(id) init {
	if ((self = [super init])) {
		self.isTouchEnabled = TRUE;
		level = [[Level alloc] initWithWorld:world ThrowableArea:150 Gravity:0.0f :-300.0f];
		[self addChild:level];
		[level addCannonBallAtPosition:100 :50];
	}
	return self;
}</code></pre>
<p>the output from the debugger<br />
[Session started at 2010-07-26 21:24:49 +0100.]<br />
GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May  5 04:36:56 UTC 2010)<br />
Copyright 2004 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type "show copying" to see the conditions.<br />
There is absolutely no warranty for GDB.  Type "show warranty" for details.<br />
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all<br />
Attaching to process 3469.<br />
2010-07-26 21:24:53.937 FingerSmash Beta 2.0[3469:207] cocos2d: cocos2d v0.99.1<br />
2010-07-26 21:24:53.938 FingerSmash Beta 2.0[3469:207] cocos2d: Using Director Type:CCDisplayLinkDirector<br />
2010-07-26 21:24:53.971 FingerSmash Beta 2.0[3469:207] cocos2d: GL_VENDOR:   Apple Computer, Inc.<br />
2010-07-26 21:24:53.974 FingerSmash Beta 2.0[3469:207] cocos2d: GL_RENDERER: Apple Software Renderer<br />
2010-07-26 21:24:53.975 FingerSmash Beta 2.0[3469:207] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1 APPLE<br />
2010-07-26 21:24:53.975 FingerSmash Beta 2.0[3469:207] cocos2d: GL_MAX_TEXTURE_SIZE: 2048<br />
2010-07-26 21:24:53.976 FingerSmash Beta 2.0[3469:207] cocos2d: Supports PVRTC: YES<br />
2010-07-26 21:24:53.976 FingerSmash Beta 2.0[3469:207] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16<br />
[Switching to process 3469]<br />
[Switching to process 3469]<br />
2010-07-26 21:24:54.061 FingerSmash Beta 2.0[3469:207] cocos2d: Frame interval: 1<br />
2010-07-26 21:25:00.592 FingerSmash Beta 2.0[3469:207] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [219] to [293].<br />
2010-07-26 21:25:00.593 FingerSmash Beta 2.0[3469:207] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [293] to [392].<br />
2010-07-26 21:25:00.594 FingerSmash Beta 2.0[3469:207] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [392] to [524].<br />
2010-07-26 21:25:00.596 FingerSmash Beta 2.0[3469:207] cocos2d: CCSpriteSheet: resizing TextureAtlas capacity from [524] to [700].<br />
2010-07-26 21:25:05.983 FingerSmash Beta 2.0[3469:207] Point 1 reached<br />
2010-07-26 21:25:05.984 FingerSmash Beta 2.0[3469:207] Point 1 reached<br />
Program received signal:  “EXC_BAD_ACCESS”.<br />
(gdb) </p>
<p>Thankyou so much if you have read through all of that, i can't say how grateful i am.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47885</link>
			<pubDate>Mon, 26 Jul 2010 18:45:55 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">47885@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thanks for all of the help guys, sorry about the lack of detail. I didn't want to post the cod straight away, as there is a lot of it and it isn't very well written, so i didn't want to have you read through it if there was an easy solution where you did not want to see the code. I will read the links, and thanks again for them.
</p></description>
		</item>
		<item>
			<title>lordbritishix on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47865</link>
			<pubDate>Mon, 26 Jul 2010 17:46:23 +0000</pubDate>
			<dc:creator>lordbritishix</dc:creator>
			<guid isPermaLink="false">47865@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I just had this problem yesterday and it took me a few hours to figure this out :) Anyway, this problem can also be caused if you delete elements from an array that you are currently iterating. </p>
<p>You can also use an NSZombie - as described in this article:<br />
<a href="http://www.codza.com/how-to-debug-exc_bad_access-on-iphone" rel="nofollow">http://www.codza.com/how-to-debug-exc_bad_access-on-iphone</a></p>
<p>as a means of helping you debug the problem.</p>
<p>Hope this helps!
</p></description>
		</item>
		<item>
			<title>hactar on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47844</link>
			<pubDate>Mon, 26 Jul 2010 16:04:09 +0000</pubDate>
			<dc:creator>hactar</dc:creator>
			<guid isPermaLink="false">47844@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>4 mb is fine, worry when you're in your 20s. The error you describe usually occurs when you're trying to access an object that has already been released or when you are running multiple threads and are not taking care of synchronization properly... But as riq says, without a proper post we can't really help you.
</p></description>
		</item>
		<item>
			<title>riq on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47838</link>
			<pubDate>Mon, 26 Jul 2010 14:55:11 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">47838@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Please, read this <a href="http://www.cocos2d-iphone.org/forum/topic/3">post</a>. It explains how to report a crash.
</p></description>
		</item>
		<item>
			<title>dcthatch on "Program recives signal EXC_BAD_ACCESS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8223#post-47836</link>
			<pubDate>Mon, 26 Jul 2010 14:46:40 +0000</pubDate>
			<dc:creator>dcthatch</dc:creator>
			<guid isPermaLink="false">47836@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am sorry that i am probably asking a very simple question, but this has really been confusing me, and i have no idea how to fix it. I thought that that error meant that there was too much memory being used, so i minimized the amount of memory that my code was using, and ran it with instruments, using allocations. I discovered that i was only using 4.37 mb of memory when the app crashed and that popped up on the debugger. If i am correct, it should be fine to use that much memory (correct me if i am wrong, i am afraid that i am fairly new to the iphone and cocos2d/box2d). Please can somebody help and suggest what the problem might be.</p>
<p>thanks.
</p></description>
		</item>

	</channel>
</rss>

