菜鸟教程小白 发表于 2022-12-12 09:14:42

ios - 如何将 MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure 设置为 false?


                                            <p><p>我正在使用 Xamarin 并尝试在 iOS 模拟器中运行我的一个应用程序,但我收到此错误:</p>

<pre><code>2015-10-07 12:38:02.715 MolinaCoding1iOS Unhandled managed exception:
Could not initialize an instance of the type &#39;UIKit.UIImage&#39;: the native &#39;initWithContentsOfFile:&#39; method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false. (System.Exception)
</code></pre>

<p>我实际上如何忽略这种情况?如果我不应该忽略这一点……那我该怎么办?</p>

<p>谢谢</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我通过在我的项目上运行“Clean”(使用 Visual Studio)解决了这个问题。右键单击您的项目并选择“清理”。之后运行应用程序。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何将 MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure 设置为 false?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/32999376/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/32999376/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何将 MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure 设置为 false?