XCode 错误:“GDB:程序接收信号:“SIGABRT”。”
我正在使用 cocos2d 0.99.5 编写一个简单的应用程序,iPhone SDK 是 4.2。我已经在设备上运行了我的应用程序,但是当我按下按钮切换 CCScenes 时,有时应用程序突然没有响应,并且 XCode 收到错误:“GDB:程序收到信号:”SIGABRT”。”
这个问题是偶然发生的。您必须多次按下转换按钮才能重现此错误。
我了解到 SIGABRT 是由 abort() 函数引发的。当断言失败时,标准的assert()宏会调用abort()。但我的程序中没有assert函数。
谁能告诉我这个问题是如何发生的,以及如何解决这个问题?我现在不知道下一步该做什么。
I am writing a simple application using cocos2d 0.99.5, the iPhone SDK is 4.2. I have run my application on device, but when I press the button to switch CCScenes, sometimes the app suddenly has no response and XCode received the error:"GDB:Program received signal:"SIGABRT". "
This issue happens by accident. You have to press the transition button many times to reproduce this bug.
I have learned that SIGABRT is raised by the abort() function. abort() is called by the standard assert() macro when an assertion fails. But there is no assert function in my program.
Could anyone tell me how does this problem happen, and how to solve this problem? I don't know what to do next now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题已经解决了。请参阅上面的评论。
The problem has been solved. See the comments above.
如果应用程序启动时收到 SIGABRT,请检查您的 XIBS
打开每个 XIB
在身份检查器中检查每个 XIB 中的文件所有者
确保提到的类是正确的并且类存在(我已重命名了一些文件,但失败)
从
检查类名称 开始在身份检查器中就可以了。
放置断点
AppDelegate
第 2 步 - 在 didFinishLaunchingWithOptions 中放置另一个断点 在
RootViewController.m (或 AppDelegate 中 VC self.viewController 的任何子类)中放置一个断点
如果它在这里崩溃,请检查 RootViewController.xib (或第一个 VC 的任何类)是)
并检查文件所有者的类是否正确
,遍历所有视图控制器
查找 initWithNibName 以查找 XIB 的名称。
在每次检查中,XIb 中的类名称都设置正确。
If you get SIGABRT when app starts check your XIBS
Open each XIB
Check the Files Owner in each in the Identity Inspector
Make sure the class mentioned is the correct one and class exists (I had renamed some files and it failed)
Start with
Check Class names in Identity Inspector is ok.
Place breakpoints in
AppDelegate
STEP 2 - in didFinishLaunchingWithOptions place another breakpoint on
In the RootViewController.m (or whatever sub class of VC self.viewController in AppDelegate is) place a break point in
If it crashes here check RootViewController.xib (or what ever class the first VC is)
and check Class is correct for Files Owner
iterate down through all View controllers
look for initWithNibName to find what XIBs are called.
In each check the Class name in the XIb is set correctly.