[MonoTouch] Binding issue
Jeff Stedfast
jeff at xamarin.com
Thu Mar 1 12:37:17 UTC 2012
Hi Morph,
Those values tend to suggest that you aren't linking with the native
library, and that it has nothing to do with your binding being wrong.
I might suggest making the following change to your binding API tho:
[Export ("numValue")]
double NumValue { get; }
[Export ("stringValue")]
string StringValue { get; }
You don't have to make this change, but I wanted to remind you that you
*could* if you felt it made your API nicer ;-)
Jeff
On Thu, Mar 1, 2012 at 12:21 AM, Morph268 <angriawan at hotmail.com> wrote:
> Hello,
>
> I am newb here
> I have problem to get my simple binding project working.
> I created a super simple class in native project. When I tried to access
> member value from my MT project, i got default values <NaN for numValue and
> null for stringValue>
>
> I know this must be some a simple thing that I forgot.
>
> Any idea what could cause the problem?
> Is there any documentation somewhere that describes how to debug binding
> issue?
>
> thank you much
>
> lib.h
>
> @interface MyLib : NSObject
>
> - (double) numValue;
>
> - (NSString *) stringValue;
>
> @end
>
> lib.m
>
> @implementation MyLib
>
> - (double) numValue {
> return 0;
> }
>
> - (NSString *) stringValue {
> return @"Hello World";
> }
>
>
> ApiDefinition.cs
>
> [BaseType (typeof (NSObject))]
> interface MyLib {
>
> [Export ("numValue")]
> double NumValue();
>
> [Export ("stringValue")]
> string StringValue();
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Binding-issue-tp4434091p4434091.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monotouch/attachments/20120301/850f58bb/attachment.html>
More information about the MonoTouch
mailing list