Liam Keeley
Liam Keeley

Reputation: 307

SIGABRT Error From An NSArray Out of Bounds Exception In a Swift App With No NSArrays

I am making an app, and I am doing my first test right now that should just show the basic layout and a little functionality. I have of course found all the compile time and runtime errors that xcode has caught, and I assume there are at least a few bugs will just make the app act weirdly, but I want to fix those after the app has actually run. Unfortunately, I am getting a SIGABRT error. First off, I am not even using Main.storyboard or ViewController.swift, so that is not the issue. No broken segues. This is what the console says: Console message.

So first I thought I just had an array out of bounds exception ("NSRangeException"), but the thing is, I never used an NSArray (I did use normal arrays though, and I am not ruling out a range out of bounds exception there, but I want to know why the console is saying it is an NSArray. If it is something else, I obviously need to know). Here is a "Stack trace" (or at least I assume so) also which I saw as a suggestion to find and error on a similar question (it was objective-c though, and he actually had an NSArray). Here is the link: similar question I don't know how to trace that back to the source, but that what it looks like leading up to the error. Basically, why I am asking this question is:

  1. If you can tell me that I am completely wrong about thinking I have an array out of bounds error and what it is instead, please do that.
  2. If you agree with me in thinking that is likely the issue, please explain to me why the compiler would refer to it as an NSArray; as far as I know, these are two completely different data structures.

Upvotes: -1

Views: 140

Answers (1)

Kerberos
Kerberos

Reputation: 4166

Without code is very hard help you.

But you can check where is the error with an exception breakpoint.

Click on the Breakpoint navigator tab (the tab selected in the image):

enter image description here

Then click on the plus button in the bottom and select Exception breakpoint:

enter image description here

After this, you can reproduce the issue and when the app crashes the debugger stop all at the line where is our (empty) nsArray.

Upvotes: 1

Related Questions