引发了Foundation.MonoTouchException,引发了Objective-C异常。名称:NSInvalidArgumentException

时间:2019-12-21 09:54:17

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

在Xamarin中运行本机iOS应用程序时,出现以下错误。

Foundation.MonoTouchException has been thrown
Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: *** -[NSPlaceholderString initWithString:]: nil argument

堆栈跟踪:

**  at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:406 
at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/runtime/Delegates.generated.cs:128 
at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
at TripplewinEWS.iOS.Application.Main (System.String[] args) [0x00002] in /Users/yudizsolutions/Documents/projects/T/Git/TripplewinEWS/iOS/Main.cs:14 
--- End of stack trace from previous location where exception was thrown ---

at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
at TripplewinEWS.iOS.Application.Main (System.String[] args) [0x00002] in /Users/yudizsolutions/Documents/projects/T/Git/TripplewinEWS/iOS/Main.cs:14 **

我找不到真正引起错误的原因。 帮助我。

谢谢。

0 个答案:

没有答案