Bug 19623 - Invocation based undo does not work on Mac
Summary: Invocation based undo does not work on Mac
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.6.9
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Bugzilla
Depends on: 22940
  Show dependency tree
Reported: 2014-05-08 15:27 UTC by Chris Hamons
Modified: 2016-09-26 21:59 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Example (20.37 KB, application/zip)
2015-02-19 17:20 UTC, Chris Hamons

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 19623 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Chris Hamons 2014-05-08 15:27:25 UTC
See http://forums.xamarin.com/discussion/15282/how-to-use-preparewithinvocationtarget-on-nsundomanager

I was able to get RegisterUndoWithTarget working, but PrepareWithInvocationTarget kept crashing.

I think it is due to some proxy support we don't have yet the customer was referencing?
Comment 1 Chris Hamons 2015-02-19 17:20:54 UTC
Created attachment 9935 [details]
Comment 2 Chris Hamons 2015-02-19 17:21:15 UTC
I found the RegisterUndoWithTarget example I hacked up and attached. Need to test w/ PrepareWithInvocationTarget.
Comment 3 Chris Hamons 2015-02-20 14:44:55 UTC
This will be fixed in XM 2.0 (mid year), but won't be pleasant. For invocation based undo, you have to send a message to the proxy that the undo returns, which when you are normally invoking a c# method is unfortunate. I have it working internally but you get to call IntPtr_objc_msgSend_* on your own exported selectors. Sticking with RegisterUndoWithTarget might be easier even with the fix.
Comment 4 Chris Hamons 2015-02-20 15:36:14 UTC
Fixed in master / d2d5c9cfe38560288c6020c96d410a03ed845050
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-02-23 05:48:40 UTC
Chris, I'm not sure this is the best way to solve it, I had another idea (for XI) in bug #26919 which might be bettetr.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-02-23 05:52:45 UTC
I ended up reverting the patch, since it crashes the unit tests.
Comment 7 Chris Hamons 2015-02-23 11:28:44 UTC
To fix this right, we really need to fix https://bugzilla.xamarin.com/show_bug.cgi?id=22940 first.