Terminating app due to uncaught exception 'NSInternalInconsistencyException'

Hello everyone,


I have been scratching my head around this crash for the last few days and cannot be sure what the issue is here:


2020-05-12 19:13:20.216755+0100 Guess the Cartoon Character[3928:259841] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFArray replaceObjectAtIndex:withObject:]: mutating method sent to immutable object'

*** First throw call stack:

(0x1bb998164 0x1bb6acc1c 0x1bb9f13a8 0x1bb9fcec8 0x1bb9e0890 0x100f4821c 0x100f302b0 0x1bfae34c4 0x1bf4cdfe8 0x1bf4ce350 0x1bf4cd368 0x1bfb1e878 0x1bfb20060 0x1bfafb1cc 0x1bfb7de0c 0x1bfb80a14 0x1bfb78c88 0x1bb913860 0x1bb9137b4 0x1bb912f04 0x1bb90dca4 0x1bb90d660 0x1c5d1e604 0x1bfae215c 0x100f2b388 0x1bb7891ec)

libc++abi.dylib: terminating with uncaught exception of type NSException


If anyone can shed some light on this crash, that would be very helpful.


Many thanks!

If you reproduce this problem outside of Xcode, it should generate a crash report. On symbolication, that crash report will have a Last Exception Backtrace section that’ll give you some idea as to where this exception is coming from.

For info on how to get started with this, see Acquiring Crash Reports and Diagnostic Logs and the various related articles.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you! After reading the crash log and trying out a few things I managed to fix the crash

Terminating app due to uncaught exception 'NSInternalInconsistencyException'
 
 
Q