简体   繁体   中英

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.

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM