Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

Mac Bindings Library

$
0
0

Ok, the Mac Bindings Library template has finally arrived by way of Xamarin 6.0. Thanks Guys. But now to understand how to use it...

There's online documentation for the older iOS Bindings Library which seems a little all-over-place to me. And there's a little in-line documentation in the ApiDefinition file which gets generated when I first create a Mac Bindings Library project which seems a tad simplistic. Apologies for my density.

In a nutshell, I'm trying to get information about installed printers on the Mac which appears to be only available via the native Core Printing API. Using XCode, I've created a native static library, libPrintCoreNativeLibrary.a, which has an interface derived from NSObject and declares a single method. In the implementation of that method, I call into the Core Printing API and generate a Dictionary of CFStringRefs which gets returned by the method. Using Xamarin Studio, I create a Mac Bindings Library project. On the first step, I add my native libPrintCoreNativeLibrary.a file to the project, but no code-behind file gets generated.

So of the three projects in play here, my native OSX library, the bindings library, and the Mac app, I have these questions...

  1. Is there some sort of dressing required in my native library in order for the bindings library to import it and generate that code-behind?
  2. Is the ApiDefinition file in the binding library just a straight pass-through layer? Or can additional business logic be added there to further process the results returned from my native library.
  3. Am I even allowed to bind to my own native library? If not, what library do I need to bind to the Core Printing API, and where is it?
  4. Is there anything else I need to know?

Thanks


Viewing all articles
Browse latest Browse all 1429

Trending Articles