-
-
Save dalexsoto/0729c9c4e7f1f7196f82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Maybe inside a helper class | |
[DllImport (MonoTouch.Constants.ObjectiveCLibrary, EntryPoint = "class_addProtocol")] | |
static extern bool AddProtocol (IntPtr cls, IntPtr protocol); | |
[DllImport (MonoTouch.Constants.ObjectiveCLibrary, EntryPoint = "objc_getProtocol")] | |
static extern IntPtr GetProtocol (string name); | |
// This ones must be called before the actual usage of the class, maybe in finished launching but up to you | |
var objRestorationProtocol = GetProtocol ("UIObjectRestoration"); | |
AddProtocol (Class.GetHandle (DetailViewController), objRestorationProtocol); | |
var ctrlRestorationProtocol = GetProtocol ("UIViewControllerRestoration"); | |
AddProtocol (Class.GetHandle (DetailViewController), ctrlRestorationProtocol); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment