1

I'm trying to create a binding library, but I don't have Intellisense support in Visual Studio 2013. My Windows computer is connected to a MacOS 10 (El Capitan) with the latest Xamarin Studio on it and even the latest XCode 8 (I don't know if this is neccessary)

I don't know if there are any references missing. I'm trying to add support for an accessory library for iOS, called "libdtdev.a" and the corresponding header "DTDevices.h". Although VS successfully builds the project I can't use the library in another Xamarin.iOS project. In the following code "BaseType", "NSObject" and the "Export" syntax is unknown.

using System;

using ObjCRuntime;
using Foundation;
using UIKit;

namespace LineaProSDK
{
    [BaseType(typeof(NSObject))]
    interface DTDevices 
    {

        [Export("sharedDevice")]
        DTDevices sharedDevice();
    } 
}

This is how the Intellisense displays the available options:

enter image description here

Can someone please tell me what I'm doing wrong? Am I missing some references? These are all Mono references I have installed on my windows client, but only "Xamarin.iOS" is selected by default:

These are the only Mono references I can add

I followed the tutorial at Walkthrough: Binding an iOS Objective-C Library

Gerrit Horeis
  • 541
  • 5
  • 14

1 Answers1

0

Xamarin doesn't offer IntelliSense for such a scenario. Would be a good idea to actually file a bug for that so Xamarin team could improve it.

Regarding iOS bindings and ApiDefinition, suggested way is to use Sharpie tool which can generate ApiDefinition from .h header file (which you mentioned you have). This way you don't need to write code yourself and don't need IntelliSense

https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/walkthrough/#Using_Objective_Sharpie

Great example is right there

sharpie bind -output DTDevices -namespace DTDevices -sdk iphoneos8.1 path-to-DTDevices.h -unified

Make sure you are using valid value for -sdk option.

Alex Sorokoletov
  • 3,102
  • 2
  • 30
  • 52