ObjC-block handler with Xojo?

I like to use an ObjC function that returns information via a block invocation.

I have a belief it in my unreliable mind that someone came up with a way to do that in pure Xojo, without a plugin. Is that so? I cannot find anything.

Well, Charles did it, apparently, in pure Xojo and declares. As this is for my Scriptable classes, which are alreay full of meddling with ObjC classes, this would be little overhead, I guess :slight_smile: I still have to understand what to do to get it working, though. Never looked at the runtime situation of blocks.

This is NOT going to be simple, I’m sure :slight_smile:

Are you looking for something like this?

if the callback is on a different thread, you may need a plugin to push it to main thread.

@jim mckay Yes, that was the post I had in mind. I have even bookmarked it but totally forgot about bookmarks in this forum - I actually still don’t know see to list bookmarked pages.

Sadly, that’s doing it the other way around, i.e. it shows how to invoke blocks. I need to supply a handler for a block.

Threads should not be a problem. The callback is supposed to come on the same thread.

I actually didn’t know there was a bookmark feature. Thanks for pointing that out.

To see your previous bookmarks, use the search bar on the home screen. Just click in the field as if you were going to search and wait for the pull down menu. Select bookmarks there. It will enter a #bookmarked for you and that should pull them up.