Swift owned to guaranteed Swift owned to guaranteed objective-c objective-c

Swift owned to guaranteed


In my opinion, you are looking at wrong places. When I am looking at the logs, what I see is:

  1. A click on a button
  2. onButtonTableViewCellClick
  3. Obj-C to Swift internals (you can learn more in What's Dead & Exploded in Swift's exception stack?)
  4. Indexing String by Int (see String.subscript.getter (Swift.Int) -> String)

We can be sure that the crash happened somewhere here:

return String(Array(self.characters)[i])

I think we can rule out nil because that would cause an earlier crash. Most likely you have an character index out of bounds problem. That means i is either negative or higher than length - 1 (maybe you are indexing an empty text?)

Unfortunately, the important code is in onButtonTableViewCellClick and you haven't posted that.