I have an app in the AppStore. I've changed some stuff and now I want to update the app to the new version.
However when I update the app, while the old version is installed and it starts running, it crashes with an error :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </private/var/containers/Bundle/Application/5B180AEC-C797-4FEF-BB0F-CA6A0C31D4E4/SwipeBaby.app> (loaded)' with name 'NbE-fw-O9r-view-3qL-iW-Xaj''
If I then run the app again, all is good and everything runs smoothly. I haven't changed the names of .xib files I believe. And I don't recognize the name that is given in the error. It does start the LaunchScreen.
Could it be that a xib file is referenced somewhere in my code that I deleted in the new version, and then at the second launch of the app it gets ignored for some reason? Is there a way to find out which xib file is meant by the error?
Any help is appreciated!
Found it :)
I was trying to add a subview to a ViewControllers view, that wasn't loaded yet.
What I did was I had a LoginViewController and passed it to another class called LoadNames as a delegate, so
var delegate: LoginViewController?. Then I checked with :BUT I used the init() of LoginViewController to call this piece of code.. so the view of LoginViewController wasn't even loaded then. But of course the delegate didn't return nil either.
This piece of code was only called when the user updated to a new version. Therefore, the second time the app runs, everything runs fine.
I found out, because of Firebase Crashlytics.