title: Xamarin iOS objective c binding library Could not create an native instance of the type
body: <p>I created a binding project for Xamarin iOS. 
  I succeeded in adding the native library, creating the C# Bindings and resolved all the hundreds of errors I found just to get this error once I try to run the library (in an app on the iPhone simulator):</p>
  
  <blockquote>
    <p>Could not create a native instance of the type 'MyNamespace.STPPaymentCardTextField': the native class hasn't been loaded.</p>
  </blockquote>
  
  <p>Here is the signature of the interface in objective-c:</p>
  
  <pre><code>@interface STPPaymentCardTextField : UIControl &lt;UIKeyInput&gt;
  </code></pre>
  
  <p>Here is what I get in my C# iOS binding:</p>
  
  <pre><code>[BaseType(typeof(UIControl))]
  [Protocol]
  interface STPPaymentCardTextField : IUIKeyInput
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/a/24316815/7442601">this stackoverflow</a> answer and checked the architecture for which my library was built and here is the architecture, taking into consideration that I run it on the iOS simulator:</p>
  
  <blockquote>
    <p>are: i386 x86_64 </p>
  </blockquote>
  
  <p>here is the script I use to build the library: </p>
  
  <pre><code>all: lib$(TARGET).a
  
  lib$(TARGET)-i386.a:
    $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release 
  clean build
   -mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@
  
  
  lib$(TARGET).a: lib$(TARGET)-i386.a 
    xcrun -sdk iphoneos lipo -create -output $@ $^
  
  clean:
    -rm -f *.a *.dll
  </code></pre>
  
  <p>How can I resolve this error please ?</p>