I'm trying to pass a function reference from JavaScript in a WebView, so my Objective-C code can call then back into that function when the asynchronous Obj-C method completes. I see how to pass in simple types -- strings, numbers, etc. -- but can't seem to figure out how to pass something a function reference, like
window.myRootObject.myObjCSelector("some-string", function(data) {
console.log(data);
});
I've Googled around, but continue to come up short, and haven't found a reference to this in the docs (yet). Working in Cocoa, but would love to be able to do the same sort of thing on iOS.
Thanks in advance for any help!
Edit: The function argument should be anonymous -- hopefully this clarifies. :)