我的应用程序在 CGRectIntersectsRect 上崩溃
我的应用程序在 CGRectIntersectsRect
上崩溃,我不知道该怎么办。
这是我的代码:
if(CGRectIntersectsRect(player.frame,enemy.frame))
{
loseViewController *controller = [[loseViewController alloc] initWithNibName:@"loseView" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:NO];
[controller release];
}
My app crashes on CGRectIntersectsRect
and I dont know what to do.
Here is my code :
if(CGRectIntersectsRect(player.frame,enemy.frame))
{
loseViewController *controller = [[loseViewController alloc] initWithNibName:@"loseView" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:NO];
[controller release];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扩展 @Vince 的评论(我不确定为什么它不是答案!)。 。 。 。
如果您这样做,它会在哪里崩溃,
而不是
That 应该告诉您哪个(或两个)对象已被释放。
Expanding on @Vince's comment (I'm not sure why it wasn't an answer!) . . . .
Where does it crash if you do
instead of
That should tell you which (or both) object has been deallocated.