Bug 29242 - Registrar cannot build a signature for array of skeleton interfaces on device only
Summary: Registrar cannot build a signature for array of skeleton interfaces on device...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.8.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-04-20 10:33 UTC by Emil
Modified: 2015-04-21 05:29 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Emil 2015-04-20 10:33:39 UTC
Compilation error when you bind objc protocols from native library to typed array.

1) Have protocols defined in objc static library, like this:

@protocol IBar;

@protocol IFoo <NSObject>

@property(nonatomic, strong) NSArray *bars;
@property(nonatomic, strong) id <IBar> currentBar;

@end

2) Bind them to Xamarin project like this (I'm using skeleton empty interface IIBar here)

// @protocol IBar <NSObject>
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface IBar
{
    // @required @property (nonatomic, strong) NSString * name;
    [Export ("name", ArgumentSemantic.Strong)]
    string Name { get; set; }
}
interface IIBar {}

// @protocol IFoo <NSObject>
[Protocol, Model]
[BaseType (typeof(NSObject))]
interface IFoo
{
    // @required @property (nonatomic, strong) NSArray * bars;
    [Export ("bars", ArgumentSemantic.Strong)]
    IIBar[] Bars { get; set; }

    // @required @property (nonatomic, strong) id<IBar> currentBar;
    [Export ("currentBar", ArgumentSemantic.Strong)]
    IIBar CurrentBar { get; set; }
}

3) Make implementations of these protocols

public class Foo : NSObject, IIFoo 
{
    //...
}

public class Bar : NSObject, IIBar
{
    //...
}

4) Build and run

Result:

MTOUCHTASK: error MT4111: The registrar cannot build a signature for type Binding.IIBar[]' in methodXTestApp.Foo.get_Bars`. Task "MTouchTask" execution -- FAILED

Xamarin.iOS version 8.8.1.9

Also this issue appears only when you deploy to device, on simulator everything works fine
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-04-21 05:29:11 UTC
Fixed.

maccore/master: 860650694dd5538ad050adf811bab6259c314282

In the meantime you can bind as an array of NSObject instead.