I'm trying to link a native iOS framework that uses AFNetworking
internally, I'm building it initially as a prototype to move some of my company's ObjC IP over to be linkable with Xamarin as well in the future.
I started by making a simple class that loads kittens using AFNetworking into an UIImageView
Header file:
#import <UIKit/UIKit.h>
@interface FWSImageRepo : NSObject
+(UIImageView *)imageViewFromURLString:(NSString *)urlString;
@end
Implementation
@implementation FWSImageRepo
+(UIImageView *)imageViewFromURLString:(NSString *)urlString{
UIImageView *imageView = [[UIImageView alloc] init];
NSURL *imageUrl= [NSURL URLWithString:@"http://www.pets4homes.co.uk/images/articles/1334/large/6-health-issues-to-watch-for-in-young-kittens-52f62cff5cabb.jpg"];
if(imageUrl != nil) {
[imageView setImageWithURL:imageUrl];
}
return imageView;
}
@end
I created a framework compiler target and I've copied the framework over to the Xamarin iOS project. I used Objective Sharpie to generate the bindings below
// @interface FWSImageRepo : NSObject
[BaseType(typeof(NSObject))]
interface FWSImageRepo
{
// +(UIImageView *)imageViewFromURLString:(NSString *)urlString;
[Static]
[Export("imageViewFromURLString:")]
UIImageView ImageViewFromURLString(string urlString);
}
All of these are linked as instructed in a binding project
, the framework is linked as a native reference and the bindings project is referenced by a single page Xamarin iOS app.
now a mere initialization of the class var fwrepo = new FWSImageRepo();
indicates to me that the framework isn't liked to the project at all. the error doesn't change even if I don't link the frameworks in the bindings project
Could not create an native instance of the type 'FWSImageRepo': the native class hasn't been loaded. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
Any reason to check what's going on? I've tried everything and exhausted my search online. theres no example of this requirement anywhere as far as I've searched and barely any direction with this. I've tried the solutions from the others facing the same issues. how do I look for where I've gone wrong?
Here's a link for the projects I've created https://drive.google.com/open?id=0B2f9RlRxZKoZcElIRkpLZnF6WVU