When trying to run an application on a connected iPhone after compiling Xcode, it produces the following error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: Could not load NIB in bundle: with name 'UIViewController-BYZ-38-t0r' and directory 'Main.storyboardc' '

First throw call stack:

(0x184801900 0x183e6ff80 0x184801848 0x1899bd1ac 0x189c1a108 0x189c1a268 0x18979d580 0x18956937c 0x18979c364 0x1897995c0 0x185db7790 0x185db7b10 0x1847b8efc 0x1847b8990 0x1847b6690 0x1846e5680 0x189562580 0x18955cd90 0x1000d18cc 0x1842868b8)

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

However, when running on the simulator, everything is normal.

How and how is it treated?

  • remove the application from the device and make clean in xcode. - Max Mikheyenko
  • It helped with the implementation: 1) Removal from the device 2) Clean 3) Build 4) Run on the device. Thank!! - Chekist
  • with permission I will convert in response - Max Mikheyenko

2 answers 2

Sometimes xcode behaves strangely, in particular, it does not overwrite xib files on the device. In particular, the renamed ones may remain under the old names, the modified ones may not be recorded and then the modifications will not be applied, and so on.

To fix this:

  • remove app from device
  • make clean in xcode
  • compile and run again

    DerivedData (the path is in the DerivedData settings, in the Locations tab)