Im trying to bind the latest version of the bump api (version 3).
This version uses blocks as callbacks when events occur.

The header file, located here:
https://github.com/bumptech/bump-api-ios/blob/master/libBump/BumpClient.h
defines the blocks like this:

/* called after a Bump or No Match is detected. */
typedef void (^BumpEventBlock)(bump_event event);

/* called after a Match has occurred. */
typedef void (^BumpMatchBlock)(BumpChannelID proposedChannelID);

/* called after both parties to a Match have confirmed the proposed Channel
*/
typedef void (^BumpChannelConfirmedBlock)(BumpChannelID channelID);

How do I bind these?

The documentation on this describes how to bind a block like this:

- (void) enumerateObjectsUsingBlock:(void (^)(id obj, BOOL *stop) block

like this:

// This declares the callback signature for the block:
delegate void NSSetEnumerator (NSObject obj, ref bool stop)
 
// Later, inside your definition, do this:
[Export ("enumerateObjectUsingBlock:")]
void Enumerate (NSSetEnumerator enum)

I cant really follow this for the bump binding.
Does typedef affect how I bind this?
Do I need to somehow declare BumpChannelConfirmedBlock as a type? how about
BumpChannelID?
Im not too familiar with objective c (hence why Im using Monotouch!).
Any help would be greatly appreciated.

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/btouch-Binding-of-Blocks-I-know-its-in-the-docs-but-having-a-little-trouble-tp4553655p4553655.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to