Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bezzawezza

macrumors newbie
Original poster
Nov 29, 2011
1
0
Wales
I have recently started using Xcode 4 since the iOS5 upgrade and since then I appear to be unable to run anything in the simulator.
Tonight I have created a simple app with 3 text fields and two buttons and corresponding IBOutlets for the text fields and IBActions for the buttons and linked them all together. That is ALL I have done.
When I run the App in the simulator it builds fine but never loads as it pauses in the debugger thingy before it gets chance to load and I get the error saying "Thread 1: Program received signal:"SIGABRT" " on the following code

Code:
int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));  <-----error here
    }
}

What can I possibly have done to have caused this and how could I rectify it? What confuses is me is that I have other Apps which run fine in Xcode 3 but when I run in Xcode 4 the simulator gives this same error. I am very confused.
 
Last edited by a moderator:
SIAGBORT generally means you did something wrong in the sence of, calling a Enumerate function on an image, i'm just giving examples. So you need to step through your code, of where it exactly goes wrong..
Thing that could also happen is that you have set some old outlets, and the XIB still has these, means he won't respond to it, and will give a SIGAbort, so please double check everything.
 
Run a backtrace after the SIGABRT was received to see exactly where in the code it was triggered. If it's in your methods/classes, step through them using breakpoints and the debugger to see what line causes it and what is the content of your variables at that time.

If it's in Apple's code, this may still be because of something you're doing (passing nil arguments, over-releasing objects, releasing objects that aren't yours...). The backtrace should give you clues already, and then using Profiler should help you trace it back to the faulty code.
 
I've had this happen to me as well, on the very first app I tried to create using Xcode 4.2, and I was able to successfully recreate it just now.

  1. Create a new project, let's call it Crash-o-matic. It's a Single View Application.
  2. Do not check any of the boxes (Use storyboard, Use Automatic Reference Counting, Include Unit Tests all unchecked), set prefix to CM.
  3. Add a label to the view in the CMViewController.xib - I added a label that said "Hello, World!"
  4. On Project Summary tab, set Main Interface to CMViewController.

Watch program crash - here's the stack backtrace:
Code:
(gdb) where
#0  0x91a0ec5a in __kill ()
#1  0x91a0ec4c in kill$UNIX2003 ()
#2  0x91aa15a5 in raise ()
#3  0x91ab76e4 in abort ()
#4  0x91a33b1b in _Unwind_Resume ()
#5  0x012efe39 in CFRunLoopRunSpecific ()
#6  0x012efccb in CFRunLoopRunInMode ()
#7  0x0000f2a7 in -[UIApplication _run] ()
#8  0x00010a9b in UIApplicationMain ()
#9  0x00001d12 in main (argc=1, argv=0xbfffed10) at /Users/qa1007/Documents/Personal/Xcode/Crash-o-matic/Crash-o-matic/main.m:16
#10 0x00001c85 in start ()

Now go change the Main Interface to nothing and rebuild. Works fine.

When I look at the code in CMAppDelegate.m, I see the following:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    self.viewController = [[[CMViewController alloc] initWithNibName:@"CMViewController" bundle:nil] autorelease];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

What I think is happening is when the interface is set, the UIApplication tries to load the main interface that doesn't have a UIWindow object and it gets very confused and causes this problem. When no interface is set, it doesn't try to load anything and just calls the delegate application:didFinishLaunchingWithOptions: method that then creates a window object and loads the view controller into it and runs normally from there.

I suspect you did the same thing I did the first time I tried Xcode 4.2 and set the Main Interface because I didn't like it being blank.

To make it work, I just selected the text for the Main Interface setting and deleted it (so the field was empty), rebuilt and reran.
 
I create a XIB to go with my UIApplication. This will create the window, so you need to hook that up via the old school AppDelegate ways, then add the controller you need. I don't use any of the new techniques, since the old ones worked fine for me.. And If I just go to old way there, adding a View Controller, or a navigation controller, and then do it the oldie way :) that should do fine.
 
Thank you !!!

I've had this happen to me as well, on the very first app I tried to create using Xcode 4.2, and I was able to successfully recreate it just now.

  1. Create a new project, let's call it Crash-o-matic. It's a Single View Application.
  2. Do not check any of the boxes (Use storyboard, Use Automatic Reference Counting, Include Unit Tests all unchecked), set prefix to CM.
  3. Add a label to the view in the CMViewController.xib - I added a label that said "Hello, World!"
  4. On Project Summary tab, set Main Interface to CMViewController.

Watch program crash - here's the stack backtrace:
Code:
(gdb) where
#0  0x91a0ec5a in __kill ()
#1  0x91a0ec4c in kill$UNIX2003 ()
#2  0x91aa15a5 in raise ()
#3  0x91ab76e4 in abort ()
#4  0x91a33b1b in _Unwind_Resume ()
#5  0x012efe39 in CFRunLoopRunSpecific ()
#6  0x012efccb in CFRunLoopRunInMode ()
#7  0x0000f2a7 in -[UIApplication _run] ()
#8  0x00010a9b in UIApplicationMain ()
#9  0x00001d12 in main (argc=1, argv=0xbfffed10) at /Users/qa1007/Documents/Personal/Xcode/Crash-o-matic/Crash-o-matic/main.m:16
#10 0x00001c85 in start ()

Now go change the Main Interface to nothing and rebuild. Works fine.

When I look at the code in CMAppDelegate.m, I see the following:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    self.viewController = [[[CMViewController alloc] initWithNibName:@"CMViewController" bundle:nil] autorelease];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

What I think is happening is when the interface is set, the UIApplication tries to load the main interface that doesn't have a UIWindow object and it gets very confused and causes this problem. When no interface is set, it doesn't try to load anything and just calls the delegate application:didFinishLaunchingWithOptions: method that then creates a window object and loads the view controller into it and runs normally from there.

I suspect you did the same thing I did the first time I tried Xcode 4.2 and set the Main Interface because I didn't like it being blank.

To make it work, I just selected the text for the Main Interface setting and deleted it (so the field was empty), rebuilt and reran.

I don't know if you are still following this page but you just helped me a ton so I registered for the site just to say thanks for posting.

This was my exact problem, the exact thing I had done and the exact fix that fixed it LOL. That stupid blank entry was just begging to be filled in !
 
Need help asap

Hey , I'm making a ping pong game and I keep getting a SIGABRT error in my main.m file only when I have the audio line of code in my .m file


Code:
    NSString *clapPath = [[NSBundle mainBundle] pathForResource:@"Clapping Crowd Studio 01" ofType:@"caf"];
	CFURLRef clapURL = (CFURLRef ) [NSURL fileURLWithPath:clapPath];
	AudioServicesCreateSystemSoundID (clapURL, &clappingFileID);
    
	NSString *volleyPath = [[NSBundle mainBundle] pathForResource:@"Tennis Volley 01" ofType:@"caf"];
	CFURLRef volleyURL = (CFURLRef ) [NSURL fileURLWithPath:volleyPath];
	AudioServicesCreateSystemSoundID (volleyURL, &volleyFileID);



when i remove it the program runs fun but without sound . Any idea how I can fix this


my main.m file is
Code:
#import <UIKit/UIKit.h>

#import "iTennisAppDelegate.h"

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

please help me
 
Last edited by a moderator:
In the debugger console there is a message printed when you get a SIGABRT. It starts with "Terminating app..." Post the contents of that message here.
 
Dude, thanks!

SIAGBORT generally means you did something wrong in the sence of, calling a Enumerate function on an image, i'm just giving examples. So you need to step through your code, of where it exactly goes wrong..
Thing that could also happen is that you have set some old outlets, and the XIB still has these, means he won't respond to it, and will give a SIGAbort, so please double check everything.

Hey I know this is REALLY old, but thank you! You solved my problem! I wasn't getting any errors and it was running with a black screen...

The problem was that I had an old outlet I had to delete because I renamed it later. Thanks a lot! :)
 
Help

Hi I keep getting the same error: terminating app due to uncaught exception 'nsunknownkeyexception'

Here is my file: https://www.dropbox.com/sh/raeiqb4fr2fnj3b/mjQowMlCvl

I would be really grateful if someone could fix it for me or tell me what the problem is. I have been looking in Forums all day and haven't managed to find the problem.

Thank you!
 
Help

Ok so...
Basically it says that my error is in this code:
Code:
[B].h[/B]

#import <UIKit/UIKit.h>
#import "Kontakt.h"

@interface KontaktDetailViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextView *addressTextView;
@property (weak, nonatomic) IBOutlet UITextView *details1TextView;
@property (weak, nonatomic) IBOutlet UITextView *details2TextView;
@property (weak, nonatomic) IBOutlet UITextView *details3TextView;
@property (weak, nonatomic) IBOutlet UITextView *details4TextView;
@property (weak, nonatomic) IBOutlet UITextView *details5TextView;
@property (weak, nonatomic) IBOutlet UITextView *details6TextView;
@property (weak, nonatomic) IBOutlet UITextView *details7TextView;

@property (nonatomic, strong) Kontakt *kontakt;

@end




[B].m[/B]


#import "KontaktDetailViewController.h"
#import "Kontakt.h"

@interface KontaktDetailViewController ()

@end

@implementation KontaktDetailViewController
@synthesize kontakt;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = kontakt.name;
    
    NSMutableString *addressText = [NSMutableString string];
    for (NSString* address in kontakt.address) {
        [addressText appendFormat:@"%@\n", kontakt];
    }
    self.addressTextView.text = addressText;
    
    NSMutableString *details1Text = [NSMutableString string];
    for (NSString* details1 in kontakt.details1) {
        [details1Text appendFormat:@"%@\n", kontakt];
    }
    self.details1TextView.text = details1Text;
    
    NSMutableString *details2Text = [NSMutableString string];
    for (NSString* details2 in kontakt.details2) {
        [details2Text appendFormat:@"%@\n", kontakt];
    }
    self.details2TextView.text = details2Text;
    
    NSMutableString *details3Text = [NSMutableString string];
    for (NSString* details3 in kontakt.details3) {
        [details3Text appendFormat:@"%@\n", kontakt];
    }
    self.details3TextView.text = details3Text;
    
    NSMutableString *details4Text = [NSMutableString string];
    for (NSString* details4 in kontakt.details4) {
        [details4Text appendFormat:@"%@\n", kontakt];
    }
    self.details4TextView.text = details4Text;
    
    NSMutableString *details5Text = [NSMutableString string];
    for (NSString* details5 in kontakt.details5) {
        [details5Text appendFormat:@"%@\n", kontakt];
    }
    self.details5TextView.text = details5Text;
    
    NSMutableString *details6Text = [NSMutableString string];
    for (NSString* details6 in kontakt.details6) {
        [details6Text appendFormat:@"%@\n", kontakt];
    }
    self.details6TextView.text = details6Text;
    
    NSMutableString *details7Text = [NSMutableString string];
    for (NSString* details7 in kontakt.details7) {
        [details7Text appendFormat:@"%@\n", kontakt];
    }
    self.details7TextView.text = details7Text;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
 
Last edited by a moderator:
Also, "fix it for me" is the wrong attitude. We're happy to help you free of charge, but most of us charge if we're going to be doing it all for someone else.
 
Also, "fix it for me" is the wrong attitude. We're happy to help you free of charge, but most of us charge if we're going to be doing it all for someone else.

I don't want anyone to do all of it. I want to know what is wrong so I can keep getting on with it. I'm stuck, that is all. And considering I have wasted a lot of time trying to figure it out, it would be nice if someone with more experience, who actually knows what is wrong, could be so kind and help me out.
 
Code:
    NSMutableString *addressText = [NSMutableString string];
    for (NSString* address in kontakt.address) {
        [addressText appendFormat:@"%@\n", [COLOR="Red"]kontakt[/COLOR]];
    }
    self.addressTextView.text = addressText;

The red-hilited kontakt makes no sense to me, in the loop context.

Since you've copy-pasted the same thing a total of 8 times, you have 8 fixes to make (if this is a bug). If you'd made a function or method, you'd have one place to fix, as well as one place to put a breakpoint, so you could see what happens using the debugger. Or are you not using the debugger?
 
See my post #9 above. Tell us what it says.

2013-02-22 09:53:48.683 KSA[566:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<KontaktDetailViewController 0x8a77980> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Text1.'
*** First throw call stack:
(0x1ca3012 0x10e0e7e 0x1d2bfb1 0xb8ce41 0xb0e5f8 0xb0e0e7 0xb38b58 0x242019 0x10f4663 0x1c9e45a 0x240b1c 0x1057e7 0x105dc8 0x105ff8 0x106232 0x1064da 0x11d8e5 0x11d9cb 0x11dc76 0x11dd71 0x11e89b 0x11ee93 0x11ea88 0x47ae63 0x46cb99 0x46cc14 0xd4249 0xd44ed 0xade5b3 0x1c62376 0x1c61e06 0x1c49a82 0x1c48f44 0x1c48e1b 0x1bfd7e3 0x1bfd668 0x24ffc 0x828d 0x1dc5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
 
SIGABRT is a runtime exception that happens when there is some error that can only be detected at runtime.

Yours is happening when the KontaktDetailViewController.xib file is being loaded. During that load an attempt is being made to connect an IBOutlet named Text1, but there is no IBOutlet with that name.

Presumably you had such an IBOutlet at one time but removed it.

To fix this: open the nib in IB and remove the connection to that IBOutlet. It will probably show up in yellow in the HUD window for File's Owner.
 
SIGABRT is a runtime exception that happens when there is some error that can only be detected at runtime.

Yours is happening when the KontaktDetailViewController.xib file is being loaded. During that load an attempt is being made to connect an IBOutlet named Text1, but there is no IBOutlet with that name.

Presumably you had such an IBOutlet at one time but removed it.

To fix this: open the nib in IB and remove the connection to that IBOutlet. It will probably show up in yellow in the HUD window for File's Owner.

that worked. Thank you!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.