Forum Xamarin.iOS

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:
`@interface JohansBibliotek : NSObject

  • (int) sum:(int)first with:(int)second;

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

'namespace bindit {

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

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



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

What am i doing wrong?


Sign In or Register to comment.