iphone - How to implement a callback with phonegap -


working on testing phonegap on iphone; have plugin returns simpl json data :

nsstring* retstr = [[nsstring alloc]    initwithformat:@"%@({ code: '%@', image: '%@' });",    resulttext.text,resultimage.image];                         [ webview stringbyevaluatingjavascriptfromstring:retstr ];   

and call js :

var mydata = phonegap.exec("mymodile.myfunction", 'mycallback');   function mycallback (data) { alert (data); } 

doesn't produce upon return.

any idea ?

// callback arguments nsstring * jscallback = [arguments objectatindex:0];  // create string nsstring* retstr = [[nsstring alloc]      initwithformat:@"%@({ code: '%@', image: '%@' });",                                  jscallback,resulttext.text,resultimage.image];    //execute [ webview stringbyevaluatingjavascriptfromstring:retstr ];  

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -