当我去构建和调试我的iOS应用程序时,模拟器会运行,但会引发异常,并且模拟器无法打开。我正在使用Visual Studio for Mac。

错误是:

Objective-C exception thrown.Name: NSInvalidArgumentException Reason:
Could not find a storyboard named 'Main' in bundle NSBundle
</Users/(Username
here)/Library/Developer/CoreSimulator/Devices/23E98CA3-FC40-4AA4-8AAD-
62A9FADE1118/data/Containers/Bundle/Application/715B09C7-FBF2-41E6-
8FCD-A6329DE9E758/(AppName Here).app> (loaded)
Native stack trace:
    0   CoreFoundation                      0x0000000108f31b0b
__exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x0000000113b0e141
objc_exception_throw + 48
    2   UIKit                               0x000000010d005cfb +
[UIStoryboard storyboardWithName:bundle:] + 663
    3   UIKit                               0x000000010c84590d -
[UIApplication _loadMainStoryboardFileNamed:bundle:] + 72
    4   UIKit                               0x000000010c845e13 -
[UIApplication _loadMainInterfaceFile] + 260
    5   UIKit                               0x000000010c8444b6 -
[UIApplication _runWithMainScene:transitionContext:completion:] + 1407
    6   UIKit                               0x000000010c8417f3 -
[UIApplication workspaceDidEndTransaction:] + 182
    7   FrontBoardServices                  0x00000001168265f6
__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    8   FrontBoardServices                  0x000000011682646d -
[FBSSerialQueue _performNext] + 186
    9   FrontBoardServices                  0x00000001168267f6 -
[FBSSerialQueue _performNextFromRunLoopSource] + 45
    10  CoreFoundation                      0x0000000108ed7c01
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    11  CoreFoundation                      0x0000000108ebd0cf
__CFRunLoopDoSources0 + 527
    12  CoreFoundation                      0x0000000108ebc5ff
__CFRunLoopRun + 911
    13  CoreFoundation                      0x0000000108ebc016
CFRunLoopRunSpecific + 406
    14  UIKit                               0x000000010c84008f -
[UIApplication _run] + 468
    15  UIKit                               0x000000010c846134
UIApplicationMain + 159
    16  ???                                 0x000000012bee336c 0x0 +
5031998316
    17  ???                                 0x0000000128fc6abd 0x0 +
4982598333


谢谢,
ž

编辑:

添加图片。

Info.plist

最佳答案

在您的项目中似乎找不到main.storyboard。
选中此c# - 调试Xamarin C#iOS App时引发Objective_C异常-LMLPHP

如果Main Interface是Main,请检查项目中是否存在main.storyboard。
或者您可以将其更改为其他viewController。

关于c# - 调试Xamarin C#iOS App时引发Objective_C异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45227222/

10-12 00:01
查看更多