IOS binding - unrecognized selector sent to instance

TobiasOlofssonTobiasOlofsson SEMember
edited August 2014 in Xamarin.iOS

I'm trying to make an easy example project to understand binding. I get this error msg
Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[JohansBibliotek sum:with:]: unrecognized selector sent to instance 0x175e2260

This is my objective C library code:
.h
`@interface JohansBibliotek : NSObject

  • (int) sum:(int)first with:(int)second;
    @end`

.m
#import "JohansBibliotek.h"
@implementation JohansBibliotek
- (int) sum:(int)first with:(int)second
{
return first+second;
}
@end

ApiDefenition
'namespace bindit {

[BaseType (typeof (NSObject))]
public partial interface JohansBibliotek {

    [Export ("sum:with:")]
    int sum (int first, int Second);
}

}'

TestClass.cs

JohansBibliotek a = new JohansBibliotek ();
int hmm = a.sum (2, 3);

What am i doing wrong?

Posts

Sign In or Register to comment.