I'm trying to create bindings for GPUImage project, but none of binded classes is working. For example, GPUImageView:
In ObjC it's declared like this (header in git):
@interface GPUImageView : UIView <GPUImageInput>
//then some fields, properties and methods I'm not interested in
So, my ApiDefinition.cs looks like this:
namespace GPUImage
{
[BaseType (typeof(NSObject))]
[Model]
interface GPUImageInput {
}
[BaseType (typeof(UIView))]
interface GPUImageView : GPUImageInput {
[Export ("initWithFrame:")]
IntPtr Constructor(RectangleF frame);
}
}
LinkWithAttributes:
[assembly: LinkWith ("libGPUImage.a", LinkTarget.Simulator | LinkTarget.ArmV7 | LinkTarget.ArmV7s, ForceLoad = true, Frameworks = "CoreMedia CoreVideo OpenGLES QuartzCore AVFoundation UIKit Foundation")]
It builds ok and creates dll. But when I try to use it in my project like this:
var iv = new GPUImageView (new RectangleF (0, 0, 100, 100));
Exception throwed:
Could not create an native instance of the type 'GPUImage.GPUImageView': the native class hasn't been loaded. It is possible to ignore this condition by setting Class.ThrowOnInitFailure to false.
After MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure == false
iv
was created, but unusable (e.g. AddSubview(iv)
show nothing).
I suppose there is something wrong with GPUImage.a file, but I don't know how to test it in any way.
Here is 7z with 2 projects in it: TryingBindings -- bindings themselves; TryingGPUImage -- bindings in use;
Thanks in advance.
init
methods in here.