Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bindind project can't find type Basetype attribute

I'm trying to bind a objective-c library. The BaseType attribute can not be founded!

I'm following the Xamarin's site tutorial. I also tried to search on web and I found some solutions, like:

  1. Someone saying I did not create a Xamarin ios bindind project, but I have the ApiDefinition.cs and StructsAndEnums.cs;

  2. Setup the propriety to ObjcBindingApiDefinition;

  3. Uses Objective Sharpie, but it get a lot of errors.

I can't remember any more, but none of them works.


Here's the modified auto generated code:

namespace BindingProject
    {
        using System;
        using System.Drawing;
        using System.Collections;
    
        using MonoTouch.CoreGraphics;
        using MonoTouch.CoreAnimation;
    
        using MonoTouch.ObjCRuntime;
        using MonoTouch.Foundation;
        using MonoTouch.UIKit;
      
        [**BaseType** (typeof (NSObject))]
    
        interface UIResponder {
    
        }
    }

I create the project going on the solution:

  1. c#
  2. IOS
  3. Select Classic or Unified API (I can't remember now, because both have the type)
  4. I selected IOS Binding Project.

What I know is when I select one, Classic or Unified, I can't find any MonoTouch types.

like image 637
Teask Nick Avatar asked Mar 16 '26 02:03

Teask Nick


1 Answers

MonoTouch types are Classic API, in your description you are using Unified API. There are two sets of APIs co-exist in Xamarin now, please make sure not mix them together. You need to choose Classic API and follow its rule, or using Unified API and follow its own rule. The differences are mostly reference dlls, namespace and type.

http://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/unified_components/

like image 88
Anurag Kondeya Avatar answered Mar 18 '26 16:03

Anurag Kondeya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!