c# - 调试 Xamarin C# iOS App 时抛出 Objective_C 异常

标签 c# ios xamarin xamarin.ios visual-studio-mac

当我开始构建和调试我的 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

谢谢, Z

编辑:

正在添加图片。

Info.plist

最佳答案

您的项目中似乎找不到 main.storyboard。 检查这个pic

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

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

相关文章:

c# - 在 C# 中获取三个月(季度)代码

c# - 如何读取 PNG 文件并将其写入数据库?

ios - iOS 上的计时器不起作用

ios - 在 ios 开发中是否有一些 bool 值的 performSelector

xamarin - Xamarin 中的信用卡支付

xamarin - Xamarin.Forms 选项卡页面中选项卡栏的颜色由什么决定?

c# - 可扩展工厂设计模式

c# - 在 C# 的 Access 中按日期在 Asc 中对数据进行排序

ios - 解析查询以查看 friend 信息是否已更改

c# - Xamarin 中的包安装错误