I followed the documentation and was successful in building a Xamarin.iOS binding for a third party framework. I used Objective Sharpie to generate my binding code and then made some minor changes to remove verify attributes, add class names etc. My project builds fine.
When I call the singleton instance of this library, it's always null and my app crashes. I tried creating a test project in Swift and used the cocoa pod for this and everything works fine there. There's nothing of significance in the debug output, just that the singleton instance is null.
Any pointers to get this working?
- Used @objc for existing swift classes.
- Used objective-sharpie tool to generated ApiDefinition and StructsAndEnum, and used these classes along with .framework library of third party framework.
- Build the ios binding project and generated DLL.
- Singleton shared instance of One of the class is always null.
Below is the generated code from DLL.
[BindingImpl(BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)] public static NokeDeviceManager Shared { [Export("shared")] get { return Runtime.GetNSObject(Messaging.NativeHandle_objc_msgSend(class_ptr, Selector.GetHandle("shared"))); } }