Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

--- Objective-C --- I can't find a way to fix this: Thread 1: signal SIGABRT

I'm trying to build the simple iPhone app with Objective-C: fun fact. at one point the view stopped showing up when I clicked run. I've fixed that, but when I click the button "show another fact!" it returns to the code with the following:

In main.m the following is highlighted:

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

}

In ViewController.m the section connected to the button is connected:

  • (IBAction)showFunFact {

    NSArray *facts = [[NSArray alloc] initWithObjects: @"Ostriches can run faster than horses.", @"Dolphins sleep with one eye open.", nil];

    self.funFactLabel.text = [facts objectAtIndex:1];

    }

In ViewController.h the section for this screen is:

@property (weak, nonatomic) IBOutlet UILabel *funFactLabel;

The main.h and main.m areas are already provided in a template.

1 Answer

The error: signal SIGABRT means that you most likely made a connection with the Interface Builder, but then decided you did not need it anymore and deleted the code from the file but did not delete the connection. Open the utilities panel on the left of the screen and select the connections inspector and check to see if there is a connection to the interface builder that is no longer in your code.