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) (show other bugs)
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)

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

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

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.

Note You need to log in before you can comment on or make changes to this bug.