Ahhh you are Right Nic I missed one little detail yesterday

Those 2 first params are primitives thats why those are ref

So just adding my 2 cents

In objective c

(NSSomething *) normal ivar
(NSSomething **) out ivar
(Inout NSSomething *) ref ivar

Alex

El 15/10/2012, a las 03:49 a.m., Nic Wise <[email protected]> escribió:

Anything * is usually a ref

(int *) foo

ref int foo

(* = pointer to, or a reference to)

I didn't know ** is an out tho, but it makes sense.

int means "I'm giving you this number, you can do whatever you like with
it, I dont want it back"
int * means "see that int over there in that pidgin hole? you can read or
change it as you like. I'll see what you do when you return"
int ** (*) means "see that pidgin hole over there. In it is a piece of
paper with the number of another pidgin hole. you can change the number to
another pidgin hole, or you can just change the one I provided (if I
provided one)"

And the analogy breaks down from there :)

(*) not sure this would work with an int or if it needs an object....

As for your original problem, this:

DTDevices devices = new DTDevices();

will never work, as the object doesn't have a (public?) constructor. It
might have a nonpublic one internally, but it exposes a singleton for you
to use:

/**
 Creates and initializes new class instance or returns already initalized
one. Use this function, if you want to access the class from different
places
 @return shared class instance
 **/
+(id)sharedDevice;

So, you need to call:

var mydevice = DTDevices.SharedDevice;

or something like it. It'll make it, or reuse the one it has.

[Static][Export ("sharedDevice")]
DTDevice SharedDevice { get; }

(I dont think you need the : on the end, as it doesn't take a parameter)



On Mon, Oct 15, 2012 at 4:55 AM, Alex Soto <[email protected]> wrote:

> Weird, anyways glad it worked
>
> Alex
>
> El 14/10/2012, a las 22:51, Dean Cleaver <
> [email protected]> escribió:
>
> Changing it to:****
>
> [Export("getBatteryCapacity:voltage:error:")]****
> bool GetBatteryCapacity(ref int capacity, ref float voltage, out NSError
> error);****
>
> Works J****
>
> *From:* [email protected] [mailto:monotouch-
> [email protected]] *On Behalf Of *Dean Cleaver
> *Sent:* Sunday, October 14, 2012 22:49
> *To:* Alex Soto
> *Cc:* [email protected] ([email protected])
> *Subject:* Re: [MonoTouch] Correct Bindings****
> ** **
> I’d made a mistake in the Export – I had this:****
>  ****
> [Export("getBatteryCapacity:capacity:voltage:error:")]****
>  ****
> However, it’s not returning the right values. Capacity should return 100
> as it’s fully charged, but it’s returning 0.****
>  ****
> Dino****
>  ****
> *From:* Alex Soto [mailto:[email protected] <[email protected]>]
> *Sent:* Sunday, October 14, 2012 22:42
> *To:* Dean Cleaver
> *Cc:* [email protected] ([email protected])
> *Subject:* Re: [MonoTouch] Correct Bindings****
>  ****
>  ****
> [Export("getBatteryCapacity:voltage:error:")]****
> bool GetBatteryCapacity(int capacity, float voltage, out NSError error);**
> **
>  ****
> thats it ****
>  ****
> Alex****
>  ****
> El 14/10/2012, a las 22:29, Dean Cleaver <
> [email protected]> escribió:****
>
>
>
> ****
> And this one?****
>  ****
> *- (BOOL) getBatteryCapacity:*****
> *(int *)*****
> *capacity*****
> *voltage:*****
> *(float *)*****
> *voltage*****
> *error:*****
> *(NSError **)*****
> *error*****
>  ****
> The capacity and voltage seem to be out or ref parameters from the way the
> method looks to work?****
>  ****
> Dino****
>  ****
> *From:* [email protected] [mailto:monotouch-
> [email protected]] *On Behalf Of *Dean Cleaver
> *Sent:* Sunday, October 14, 2012 16:29
> *To:* [email protected]
> *Subject:* [MonoTouch] Correct Bindings****
>  ****
> What would be the correct binding for this:****
>  ****
>
> (id)****
>
> + *DTDevices::sharedDevice*****
>
> Creates and initializes new class instance or returns already initalized
> one.****
>  ****
> Cheers,****
> Dino****
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch****
>
>
>
>
>
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>


-- 
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop.
http://goo.gl/Vcz1p
London Bike App: Find the nearest Boris Bike, and get riding!
http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to