[Mono-osx] Regression in NSKeyedUnarchiver

Richard Markiewicz rmarkiewicz at devolutions.net
Thu May 2 17:42:59 UTC 2013


My code which uses NSKeyedUnarchiver now throws a TypeLoadException when using the latest monomac from Git:

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

The same code runs fine using the version of monomac.dll which ships with Xamarin Studio.

Test case:

        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);
                }
            }
        }

Exception is thrown at "new NSKeyedUnarchiver(data))".

Does anyone have an idea? Or a workaround?

Thank you!


More information about the Mono-osx mailing list