icethawless
icethawless

Reputation: 95

XCode error: "GDB:Program received signal: "SIGABRT"."

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.

Upvotes: 1

Views: 19204

Answers (2)

brian.clear
brian.clear

Reputation: 5327

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.

Upvotes: 0

icethawless
icethawless

Reputation: 95

The problem has been solved. See the comments above.

Upvotes: 1

Related Questions