cocos2d iphone游戏重启后崩溃

时间:2011-07-07 17:16:36

标签: iphone xcode cocos2d-iphone

我目前正在使用cocos2d为iphone制作游戏。

游戏运行完美,直到我尝试重启程序。如果我退出,请结束应用程序(双击主页按钮,然后从当前运行的应用程序栏中删除游戏图标),然后重新启动,则会出错。如果我退出并重新启动而不结束程序,它将从中断处继续。我还没有在实际的iphone上测试这个,只有模拟器。它在应用程序第一次启动时不会崩溃。有人可以帮忙吗?

这是程序崩溃的行:(来自main.m)

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

出现以下错误:线程1:程序收到信号:“SIGKILL”

这是输出:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)

Copyright 2004 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB.  Type "show warranty" for details.

This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all

Attaching to process 75619.

2011-07-07 10:02:21.765 Mellow Adventures[75619:207] cocos2d: cocos2d v1.0.0-beta

2011-07-07 10:02:21.767 Mellow Adventures[75619:207] cocos2d: Using Director Type:CCDirectorDisplayLink

2011-07-07 10:02:21.843 Mellow Adventures[75619:207] cocos2d: OS version: 4.3.2 (0x04030200)

2011-07-07 10:02:21.844 Mellow Adventures[75619:207] cocos2d: GL_VENDOR:   Apple Computer, Inc.

2011-07-07 10:02:21.845 Mellow Adventures[75619:207] cocos2d: GL_RENDERER: Apple Software Renderer

2011-07-07 10:02:21.845 Mellow Adventures[75619:207] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1 APPLE

2011-07-07 10:02:21.846 Mellow Adventures[75619:207] cocos2d: GL_MAX_TEXTURE_SIZE: 2048

2011-07-07 10:02:21.849 Mellow Adventures[75619:207] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16

2011-07-07 10:02:21.850 Mellow Adventures[75619:207] cocos2d: GL_MAX_SAMPLES: 4

2011-07-07 10:02:21.851 Mellow Adventures[75619:207] cocos2d: GL supports PVRTC: YES

2011-07-07 10:02:21.853 Mellow Adventures[75619:207] cocos2d: GL supports BGRA8888 textures: YES

2011-07-07 10:02:21.854 Mellow Adventures[75619:207] cocos2d: GL supports NPOT textures: YES

2011-07-07 10:02:21.854 Mellow Adventures[75619:207] cocos2d: GL supports discard_framebuffer: YES

2011-07-07 10:02:21.855 Mellow Adventures[75619:207] cocos2d: compiled with NPOT support: NO

2011-07-07 10:02:21.856 Mellow Adventures[75619:207] cocos2d: compiled with VBO support in TextureAtlas : YES

2011-07-07 10:02:21.857 Mellow Adventures[75619:207] cocos2d: compiled with Affine Matrix transformation in CCNode : YES

2011-07-07 10:02:21.858 Mellow Adventures[75619:207] cocos2d: compiled with Profiling Support: NO

2011-07-07 10:02:21.880 Mellow Adventures[75619:207] cocos2d: surface size: 480x320

[Switching to process 75619 thread 0x580b]

AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved

[Switching to process 75619 thread 0x207]

2011-07-07 10:02:23.419 Mellow Adventures[75619:207] cocos2d: Frame interval: 1

2011-07-07 10:02:30.265 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

2011-07-07 10:02:32.587 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

2011-07-07 10:02:32.589 Mellow Adventures[75619:207] cocos2d: Frame interval: 1

2011-07-07 10:02:35.239 Mellow Adventures[75619:207] cocos2d: Frame interval: 15

Current language:  auto; currently objective-c

(gdb)

2 个答案:

答案 0 :(得分:1)

我在Xcode 4中发现,对于任何应用程序,如果您正在运行允许断点(调试模式),然后转到主屏幕,然后关闭应用程序(双击主页按钮等),然后尝试从主屏幕启动它(所有这些都没有停止当前的xcode调试会话),它吓坏了(即使你在SIGKILL的调试器中继续关闭你的应用程序后继续)。如果它恢复正常并开始第一次罚款,我现在不担心它。

如果您正在设备上调试(使用Xcode插入),这似乎也会发生,但如果您拔掉设备并尝试将问题作为独立复制,则可以正常工作。

我还没有将它提交给苹果,但请随意。 :)

答案 1 :(得分:0)

在构建环境中使用NSZombieEnabled以获取有关此崩溃的更多信息。