Created attachment 16060 [details]
complete example implementation that crashes
Implementing INSWindowRestoration causes a crash when performing window restoration.
Unable to locate the block to delegate conversion method for the method WindowRestorationBug.TestWindowController.RestoreWindow's parameter #3. Please file a bug at http://bugzilla.xamarin.com.
Example solution attached. FIrst make sure "close windows the quiting an app" is turned of in General system preferances.
Then run the. Change some window locations, quit and run again
Rolf - That looks like an exception in the Runtime.cs (in your neighborhood). Bounce back to me if I'm wrong.
I can reproduce.
This happens because at runtime we need access to the BlockProxy attribute for the RestoreWindow's completionHandler, but that information is not present in the assembly because the method is a required static member (the attribute can be found for required instance members because they're on the IProtocol interface, and for optional members because they're in the Protocol_Extensions class, but for *required static* members, we don't generate anything).
Unfortunately I'm not quite sure where to add the attribute so that it's available at runtime.
a) Add required static members to the Protocol_Extensions class.
b) Add an attribute somewhere (assembly-level?) that can map delegate to blockproxy: [assembly: BlockProxy (target: typeof (NSWindowCompletionHandler), typeof (ObjCRuntime.Trampolines.NIDNSWindowCompletionHandler))]
At least b) would require some linker help though, so that those attributes aren't preserved unless needed.
I'll have to think a bit about this.