好,我有我的代码有问题:触摸在cocos2d精灵crashs我的应用程序
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* myTouch = [touches anyObject];
CGPoint location = [myTouch locationInView: [myTouch view]];
location = [[CCDirector sharedDirector]convertToGL:location];
CGRect MoveableSpriteRect =CGRectMake(oeuf1.position.x -(oeuf1.contentSize.width/2),oeuf1.position.y-(oeuf1.contentSize.height/2),oeuf1.contentSize.width,oeuf1.contentSize.height);
if (CGRectContainsPoint(MoveableSpriteRect, location)) {
[self removeChild:oeuf1 cleanup: YES];
[self removeChild:ombreOeuf1 cleanup: YES];
}
}
当我触摸oeuf1它像消失,我想,但这时如果我再次触摸屏幕我的应用程序崩溃我不知道为什么?我该如何解决这个问题?谢谢 。对不起,我的英语我是法国人:/
你能给有关崩溃的一些信息的问题的原因是什么?调试器说什么? – Dancreek 2012-02-28 21:35:51
我的应用程序停机,相当这是我所知道 – 2012-02-28 21:36:17
设置断点,单步调试和检验值,发现哪里出了问题。 – 2012-02-28 22:51:36