Objective C binding on MonoTouch - objective-c

Hi i'm currently developing a monotouch app, where i need to use the IDBlue framework for connecting from the ipad to their blueetooth reader, but is shipped as a framework without a .a, how i should proceed to make the binding so i can use it on monotouch?

The easiest way is to create a Bindings project in your solution.
This document describes the whole process.
Also there is a tool (Parser.exe) to help generate bindings. Surprisingly this tool is not mentioned in the "Binding Objective-C Types" document. It is not a complete solution but will give you a good start.

Related

Xamarin.iOS Pdf search

We develop with Xamarin.iOS and are trying to search/highlight in a PDF.
There is an iOS class for searching, CGPDFScanner, but unfortunately no bindings are offered by Xamarin.
Is there a solution or we should forget about it?
We believe that there is a way to make bindings for existing iOS classes.
Or we could probably use an existing project, like PDFKitten, and make Xamarin bindings.
Any hints?
Xamarin offers way for creating binding library. If you have some working and tested solution available in Objective C, create Binding library in tamarin and use that. You can check detailed document of it from here
I have created binding library for one of my project where i had to integrate third party sdk which was only in objective C. I followed step given here and it worked.

Mono + Xcode: How to author a library in C# using Xamarin Studio, and consume it in a CocoaTouch project within Xcode?

For an iOS app that will eventually be ported to Android/Winphone, I would love to be able to write some re-usable libraries in c#, but author the iOS UI in traditional Obj-C and reference the library written in c# from Xcode and consume it from Obj-C.
I've found lots of docs that talk about going the other way via bindings (Obj-C -> C#), but not much pertaining to my question. Also, a similar question was asked 4 years ago here, but a lot has changed in the ecosystem, the info seems out of date, and some of the links in the answers now redirect elsewhere:
Is there a way to mix MonoTouch and Objective-C?
So, is this possible? If so how, and what's the best way to achieve it today? (Or alternately, is this a bad idea and should be abandoned?)
No, it is not currently possible to consume a C# library from Objective-C.
Note that it is usually possible to do it the other way with some ingenuity - the only real requirement is that the app must be a Xamarin.iOS app and the entry point the managed Main method. In your Main method you can call into native (C/Objective-C) code and have all your logic there.

Binding objective-c library to Xamarin Project using Objective Sharpie

I am developing an iOS application using Xamarin Studio. The application is going to work with Infinite Peripherals Linea Pro 5 (a barcode scanner that you attache to an iPod/iPhone).
The Linea SDK provided by Infinite Peripherals is an objective-c library with an associated header file. I've followed Xamarins iOS binding tutorial, skipping the first parts and starting at chapter "3.2. Create a Xamarin.iOS Binding Project" (since I already have the fat binary file).
I have installed Objective Sharpie v0.4.11 and the Xcode Command Line Tools.
When I try to create the binding using Objective Sharpie I get the following error message:
After some research I find that this probably is a bug caused by Objective Sharpie, but is there any way around this bug? I really need to get this library in to my MonoTouch project.
P.S.
I have also checked out the tutorial by David Sandor, but it is really outdated and I do not possess enough knowledge to update it.
If Objective-Sharpie doesn't work for your project, you can:
Do a manual binding, or build upon David Sandor's one. That's not that hard.
Try to find the offending part of the header file, by removing part of it and process it with Obj-Sharpie (the header file is not that long, once you strip the comments away)

Objective-C in Mono

I have a .NET application, which I want to port to OSX. Up to now I used a DirectShow DLL for WebCam handling. Can I use an Objective-C DLL for Mono? How? I'm a newbie on Mac. Is there an existing (WebCam handling) solution for this? Is there a better solution?
You want to use the QTKit framework to do this, in particular you can use the QTCaptureView as a reusable NSView that you can embed in an existing window or in an application to do the actual video capturing.
I have just added support for capturing to the MonoMac bindings a few minutes ago after I saw your question, so you will need to do a little bit of work.
Steps:
Install Mono, MonoDevelop and the MonoMac addin as described here: http://mono-project.com/MonoMac
Download the latest sources for MonoMac and MacCore from Github: http://github.com/mono/maccore and http://github.com/mono/monomac
Update the MonoMac.dll to the latest version, by going into the monomac/src directory and typing "make update"
At this point you should be able to use the QTCaptureView in your MonoMac applications like any other NSView. A tutorial showing the use of the API in Objective-C is here:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/QTKitApplicationTutorial/BuildingaSimpleQTKitCaptureApplication/BuildingaSimpleQTKitCaptureApplication.html#//apple_ref/doc/uid/TP40008155-CH8-SW1
You can just use the equivalent versions in C#
I'm not sure what you mean by "an object-c dll for Mono".
Your absolute best approach is to learn the platform you're targeting and port only the logic and general architecture.
To access cameras, microphones, line-ins, etc. on Mac OS X, use QTKit (Quicktime Kit). It's mind-numbingly simple to set up a web cam view, record to files, grab frames, etc. It's built in and designed to make this sort of thing mostly drag-and-drop for developers.
MonoMac is just one alternative. There are Monobjc, CocoSharp, NObjective, MObjc / MCocoa and ObjC# (I cannot choose between them). Theese are all "bridges" between Mono and Cocoa, what mean you can use Cocoa API in Mono application. But I don't want to use the API directly. I just want a dinamically linked library, which provide me some function for WebCam handling (as I said, I did this up to this time on Windows). In other words: I need a wrapper in Mono for QTKit.
PS: If I rewrite the application in object-c that means several months, and double work in the future when the application will grow. I love object-c but I hate to work unnecessary.
I tried the accepted code in XCode, and when I tried to port to Monodevelop, several classes are missing, eg. QTCaputureSession, QTCaputreDeviceInput, CVimagebuffer.
(Sorry, I cannot edit my previous messages, this is another account.)

Are There Any Good Open-Source Mac Application Templates

I am looking to make a Mac version of one of my iPhone apps and was looking for a good ay to hit the ground running. I know how to code in Objective-c and Cocoa, and I know how to piece something together from scratch if I have to, but I am looking for an easier way.
Are there any open-source templates for coding Mac desktop applications that I might be able to pick up and use to get started off without reinventing the wheel?
EDIT:
I guess what I am looking for is an easy way to get started on an app that has the "iTunes Look and Feel". If there are some bare-bones version of this layout as some sort of template project, that would be great. Also, why has somebody down-voted this question? Have I asked something that is not appropriate for SO?
Apple includes lots of project templates with Xcode (vanilla application, document-based application, Core Data document-based application, etc.). I don't really know how much more you would want in a template. They're generally pretty good for getting you started, I think. If you're looking for something more than these offer out of a "template," maybe you could elaborate.
If you're just looking for a starting point for the interface, then check out BW Toolkit:
http://brandonwalkin.com/bwtoolkit/
He has some nice videos on his site showing how to create a Mail-like interface very quickly.
Besides the project templates included with Xcode, you should browse the application exmples in /Developer/Examples. Most of these examples are "full" applications that demonstrate one or more Cocoa-related concepts. Many could serve as the starting point for a similarly orriented app of your own.