I have an issue with binding on Xamarin.iOS.
I have 2 libraries: libA.a libB.a
And libB.a is depend on libA.a classes. In libA I have this class:
namespace ABC {
[BaseType (typeof (NSObject))]
public partial interface ClassAbc {
[Export ("setString:")]
void SetString (string abc);
}
}
And in libB I have this code:
namespace ABCUsage {
[BaseType (typeof (NSObject))]
public partial interface ClassAbcUsage {
[Export ("setAbc:")]
void SetAbc (ClassAbc abc);
}
}
I have no source code of libA.a and libB.a but only universal static libraries and headers.
I tried to add libA binding project and final A.dll as a Reference for libB binding but it says "namespace ABC not found".
How should I make a correct binding for libB?
Hello you can bind as many libraries as you want in a single binding project, just make sure you specify fully qualified type names
namespace ABC {
[BaseType (typeof (NSObject))]
public partial interface ClassAbc {
[Export ("setString:")]
void SetString (string abc);
}
}
namespace ABCUsage {
[BaseType (typeof (NSObject))]
public partial interface ClassAbcUsage {
[Export ("setAbc:")]
void SetAbc (ABC.ClassAbc abc);
//^^^^^
}
}
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With