Pergunta

I have problem when I try to launch my app in iOS simulator, I need someone to fix this please, I have tried everything but still I have the same problem I got this error :

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard_iPhone.storyboard' in bundle NSBundle </Users/iYousef911/Library/Application Support/iPhone Simulator/7.1/Applications/F00ED8C4-145B-43C0-ACDA-C41EDC01D824/Azkar.app> (loaded)'
*** First throw call stack:
(
    0   CoreFoundation                      0x029c21e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x027418e5 objc_exception_throw + 44
    2   UIKit                               0x01965400 -[UIStoryboard name] + 0
    3   UIKit                               0x01401692 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 53
    4   UIKit                               0x01401949 -[UIApplication _loadMainInterfaceFile] + 245
    5   UIKit                               0x0140054e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543
    6   UIKit                               0x01414f92 -[UIApplication handleEvent:withNewEvent:] + 3517
    7   UIKit                               0x01415555 -[UIApplication sendEvent:] + 85
    8   UIKit                               0x01402250 _UIApplicationHandleEvent + 683
    9   GraphicsServices                    0x03d21f02 _PurpleEventCallback + 776
    10  GraphicsServices                    0x03d21a0d PurpleEventCallback + 46
    11  CoreFoundation                      0x0293dca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    12  CoreFoundation                      0x0293d9db __CFRunLoopDoSource1 + 523
    13  CoreFoundation                      0x0296868c __CFRunLoopRun + 2156
    14  CoreFoundation                      0x029679d3 CFRunLoopRunSpecific + 467
    15  CoreFoundation                      0x029677eb CFRunLoopRunInMode + 123
    16  UIKit                               0x013ffd9c -[UIApplication _run] + 840
    17  UIKit                               0x01401f9b UIApplicationMain + 1225
    18  Azkar                               0x00002a4d main + 141
    19  libdyld.dylib                       0x0325f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
Foi útil?

Solução

This may be due to different reasons. Check the below:

  1. Check the spelling of your storyboard name. Maybe it is different or capital letters may be different
  2. Check your bundle resources contain this storyboard from by selecting Target->Build Phases->Copy Bundle Resources. If not add it by the below plus button.
  3. Delete your app from the iOS Simulator. Then reinstall the app.
  4. Try to rename the storyboard and apply same name in Main storyboard file base name in your application plist file.

Outras dicas

I know this is an old post but just in case someone wanders in here with a similar problem. My issue was we have over a dozen targets and I was not selecting them when I created the SB.

In the left hand column, under File Inspector, make sure you check the membership that the file should belong to.

In info.plist please check if values for properties UISceneStoryboardFile and UIMainStoryboardFile are correct

<key>UISceneStoryboardFile</key>
<string>[MY_PROJECT_NAME]</string>

and

<key>UIMainStoryboardFile</key>
<string>[MY_PROJECT_NAME]</string>

Try delete Main in same point Image (In my case)

enter image description here

In my case, I accidentally mistype the name of the storyboard……

The cache is messing up everything...run this on your terminal and make sure everything inside gets cleaned up...

sudo rm -rf $HOME/Library/Developer/Xcode/DerivedData/

I have this problem but it it fixed by. there is storyboard name problem. I have my all View Controllers in Main.storyboard so there the name is "Main" and after this, write the storyboard Identifier.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top