XCode 错误:“GDB:程序接收信号:“SIGABRT”。”

发布于 2024-10-08 13:14:19 字数 321 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼泪都笑了 2024-10-15 13:14:19

问题已经解决了。请参阅上面的评论。

The problem has been solved. See the comments above.

忱杏 2024-10-15 13:14:19

如果应用程序启动时收到 SIGABRT,请检查您的 XIBS

打开每个 XIB

在身份检查器中检查每个 XIB 中的文件所有者

确保提到的类是正确的并且类存在(我已重命名了一些文件,但失败)

MainWindow.xib
RootViewController.xib

检查类名称 开始在身份检查器中就可以了。

放置断点
AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//if it enters this method then MainWindow.xib ok

第 2 步 - 在 didFinishLaunchingWithOptions 中放置另一个断点 在

   self.window.rootViewController = self.viewController;

RootViewController.m (或 AppDelegate 中 VC self.viewController 的任何子类)中放置一个断点

viewDidLoad

如果它在这里崩溃,请检查 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

MainWindow.xib
RootViewController.xib

Check Class names in Identity Inspector is ok.

Place breakpoints in
AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//if it enters this method then MainWindow.xib ok

STEP 2 - in didFinishLaunchingWithOptions place another breakpoint on

   self.window.rootViewController = self.viewController;

In the RootViewController.m (or whatever sub class of VC self.viewController in AppDelegate is) place a break point in

viewDidLoad

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文