Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix this SIGABRT error with my app? [closed]

I am currently developing an app in Xcode 4 for the IPhone and I have com across this error, "Thread 1: Program Received Signal: SIGABRT", This error is in my main.m code.

//
//  main.m
//  MyCard
//
//  Created by Nazar Gren on 2/2/12.
//  Copyright (c) 2012 Nazar Gren. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "mycardAppDelegate.h"

int main(int argc, char *argv[])
{
     @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([mycardAppDelegate         class]));
     }
 }

My error appears on the line under the @autorelease pool line. In the debugger, I get this message, "This generally means that another instance of this process was already running or is hung in the debugger." And this error only occurs when I attempt to debug my app. My app doesn't even run. Can anyone help? It would be greatly appreciated.

like image 275
user1186514 Avatar asked Jan 18 '26 04:01

user1186514


2 Answers

If this is happening on the simulator, restart your computer. If this is happening on a real device, restart the device, and if the problem persists, restart the computer as well. This problem has occurred for me multiple times, because of a zombified process left on the device/simulator when a test is unexpectedly aborted. A simple reboot will fix it.

like image 123
eric.mitchell Avatar answered Jan 19 '26 16:01

eric.mitchell


All your code gets run through the main.m. So what you really want to see is a stack trace and there's is a good example here, but I see you're using the autoreleasepool so you'll need something like

//
//  main.m
//  MyCard
//
//  Created by Nazar Gren on 2/2/12.
//  Copyright (c) 2012 Nazar Gren. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "mycardAppDelegate.h"

int main(int argc, char *argv[])
{
     @autoreleasepool {
        @try {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([mycardAppDelegate class]));
        } @catch (NSException *e) {
            NSLog(@"CRASH: %@", e);
            NSLog(@"Stack Trace: %@", [e callStackSymbols]);
        }
     }
 }
like image 35
Jacksonkr Avatar answered Jan 19 '26 16:01

Jacksonkr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!