好,我有我的代碼有問題:觸摸在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