我在静态库中有方法-(NSArray*)SetImage:(UIImage *)OcrImage;
。
我必须在 MonoTouch 中将此方法绑定为
NSArray [] SetImage(UIImage OcrImage);
当我尝试在 monotouch 类中使用方法时
NSArray[] wordArray=test.SetImage(this.imgSnapshot.Image);
但是当我调用该方法时应用程序崩溃了。
崩溃日志
System.InvalidCastException: Cannot cast from source type to destination type.
at (wrapper managed-to-native) object:__icall_wrapper_mono_object_castclass (object,intptr)
at MonoTouch.Foundation.NSArray.ArrayFromHandle[NSArray] (IntPtr handle) [0x0003a] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSArray.cs