I am currently a new developer, and I came across this error; SIGABRT. I have tried developing many apps, and a lot of them get this error. I am developing a sound matching educational app for little kids where they use one picker view in Xcode to match an animal and their sound. My code is as follows:

SIGABRT will usually have a message in the run console that will give you the error in rather plain english. If the error isn't self-explanatory, post it as an edit to your question.
–
GregDec 2 '12 at 20:11

Labelling the line doesn't help when it comes from main as that tells us nothing. Also, there's almost always a relatively easy to understand error message. This would be much faster to solve with that info. I know I'm not going to comb through pages of code with no information.
–
MetabbleDec 2 '12 at 22:16

2 Answers
2

You have to identify the line of code that is causing the problem, something we cannot identify from the snippet of code.

You may want to enable exception breakpoints, as they often can identify the precise exact line of code that is causing the exception. When I encounter exceptions in my development, I'll simply add an exception breakpoint on "All" exceptions (see Breakpoint Navigator Help or the screen snapshot below). That way, if I'm running the program through my debugger, when it encounters an exception, it will stop the code at the offending line, greatly simplifying the process of identifying the source of the problem. It doesn't always work perfectly, but it frequently finds the source of the exception more quickly than other techniques.

For a broader discussion on debugging apps (e.g. using the debugger to single step through your code, see the Xcode User Guide: Debug your App. If you know the problem is in this method, you might want to step through your code, line by line, and the problem will become self-evident.

Your compiler will definitely be giving you a warning about this. So your first step should always be to fix the compiler warnings. It's good practice to turn on the 'Treat warnings as errors' option in build settings. This means that the compiler is very strict about what it will accept and run - which means that you have to fix the warnings. There's really no excuse for having warnings from your compiler.