0
我它采用NSKeyedUnarchiver现在代码抛出一个TypeLoadException:回归在NSKeyedUnarchiver
System.EntryPointNotFoundException: monomac_IntPtr_objc_msgSend_IntPtr at at (wrapper managed-to-native) MonoMac.ObjCRuntime.Messaging:monomac_IntPtr_objc_msgSend_IntPtr (intptr,intptr,intptr) at MonoMac.Foundation.NSKeyedUnarchiver..ctor (MonoMac.Foundation.NSData data) [0x0002a] in /Users/richard/Development/MonoMacSources/gitsrc/monomac/src/Foundation/NSKeyedUnarchiver.g.cs:93
相同的代码运行正常使用monomac.dll附带的Xamarin Studio版本。
测试用例:
public NSTextFieldCell Cell = new NSTextFieldCell("string");
public override void AwakeFromNib()
{
base.AwakeFromNib();
Console.WriteLine(Cell.StringValue);
using(NSMutableData data = new NSMutableData())
{
using(NSKeyedArchiver archiver = new NSKeyedArchiver(data))
{
this.Cell.EncodeTo(archiver);
archiver.FinishEncoding();
}
using(NSKeyedUnarchiver unarchiver = new NSKeyedUnarchiver(data))
{
var cell = (NSTextFieldCell)Activator.CreateInstance(typeof(NSTextFieldCell), new object[] { unarchiver });
unarchiver.FinishDecoding();
Console.WriteLine(cell.StringValue);
}
}
}
的例外是在new NSKeyedUnarchiver(data))
抛出。
有没有人有想法?还是解决方法?
太棒了。谢谢@Rolf – TheNextman 2013-05-08 00:19:00
辉煌。谢谢。 – TheNextman 2013-05-09 14:11:46