Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:34:34+00:00 2026-06-01T20:34:34+00:00

Ok. So I had this extremely weird SIGABRT error on a complex Objective-C iOS

  • 0

Ok. So I had this extremely weird SIGABRT error on a complex Objective-C iOS program that I’m working on, and after one day of tracking I found the culprit.

Let’s say we have the following code:

NSArray *a = [NSArray arrayWithObjects:@"a", @"b", @"c", nil];
NSLog(@"tada: %@", [a objectAtIndex:-1]);

Why the hell will this terminate the program with Program received signal: SIGABRT and the debugger not even pointing to my code (but rather in some assembly part) instead of a nicer ‘index out of bounds’ and ‘hey, this line of code here be wrong’ error?

I thought I messed up the project config, so I reproduced this on a brand new project: same result.

Is there a way to configure XCode to be more nice and indicate this kind of errors in a more human understandable way ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:34:36+00:00Added an answer on June 1, 2026 at 8:34 pm

    As the documentation says:

    If index is beyond the end of the array (that is, if index is greater
    than or equal to the value returned by count), an NSRangeException is
    raised

    And the default action, when no exception handler is defined, is to… well… you can see what the default behaviour is.

    You can use @try/@catch to trap the exception, but that’s not really Objective-C-ish. You know how many elements are in the array; there’s no real need for you to be accessing elements that don’t exist.

    Exceptions like this normally have a stack trace, so you can go back to the line of code causing the error. (It might be worth switching between LLDB and GDB if it’s not working correctly. LLDB is faster and smaller but not completely reliable.(

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Had this working; at one stage. The problem is the following text is now
I had this nasty bug that disappeared in the past but now after quite
I had this error when I browse new web site that site sub from
I had this working in an old code that I didn’t end up using...
I had this doubt for sometime now, some people say that there's no such
I had this sqlcmd snippet working in batch but when I converted to powershell,
I just grappled with an annoying, extremely persistent bug that had me scratching my
I have a C# prototype that is heavily data parallel, and I've had extremely
I had this problem Cucumber scenarios for extremely long work flow And now I've
To be up front, this is homework. That being said, it's extremely open ended

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.