【发布时间】:2012-02-28 21:17:16
【问题描述】:
我的代码有问题:
- (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 时,它会像我想要的那样消失,但是如果我再次触摸屏幕,我的应用程序崩溃了,我不知道为什么?请问我该如何解决?谢谢 。对不起我的英语我是法国人:/
【问题讨论】:
-
您能提供一些有关崩溃的信息吗?调试器说什么?
-
我的应用停止了,这就是我所知道的全部
-
设置断点并单步执行并检查值以发现问题所在。
标签: iphone xcode crash cocos2d-iphone touch