Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS storyboard weird error - 'NSInternalInconsistencyException' (Main.storyboardc)

Tags:

ios

storyboard

i am working on my xcode project. i have just clean the project and try to build the project. dont know what happen i got very weird error.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'UIViewController-bSa-xT-TPG' and directory 'Main.storyboardc'

Don't know which code i have to check!! i refereed some question related to this but can't solve my problem.

EDIT:-

when i tried to search storyboardc in Find navigator. it gives result like this.

Storyboardc in Find navigator

Edit:

I am also not able to see storyboard in build phases. i have tried it to add manually but still it appears in red symbol like this.

Storyboard not detected in build phases

like image 295
Badal Shah Avatar asked Feb 09 '23 22:02

Badal Shah


2 Answers

My problem is solved. don't know is it correct method or not. i have move Main.storyboardfrom Base.lproj to any other folder. then delete Main.storyboard from this folder and again drag and drop it in mainbundle means project window and tick mark all in localization setting. then clean and build and run the project successfully.

like image 103
Badal Shah Avatar answered May 07 '23 07:05

Badal Shah


Try a Cmd+Alt+Shift+K (clean build folder) and build. That should resolve the issue if it is just an inconsistency.

There could be other reasons to getting this error as well

  1. There is a possibility you are accessing a UIControl before it is instantiated. That could also cause this issue - and that is what generally does lead to such issues

  2. instantiating the wrong view controller - related to 1 in a way (check your hierarchy and instances created in the App Delegate)

  3. A start up issue - are you doing anything on startup which might delay the loading of the app?

like image 42
lostInTransit Avatar answered May 07 '23 05:05

lostInTransit