NativeBridge icon indicating copy to clipboard operation
NativeBridge copied to clipboard

On returning values from native code to be used in callback its going into infinite loop.

Open ggthedev opened this issue 12 years ago • 0 comments

Hi, First of all thanks a lot for this library or set of files. It just eases a lot of implementation. Now coming to the issue, which i am facing, is particularly in regards to when i want to pass on the result of a native method execution to javascript callback. In principle, i assume a string of the json object is send back which is then used in the returnForCallback method of NativeBridge, but i am still facing issues cause it goes into a loop and my callback is never implemented. sample code is as follows:

  1. send a string as a argument to callback function (say "abcd").
  2. during the invocation of [_webviewMain stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"NativeBridge.resultForCallback(%d,%@);",callbackId,resultArrayString]]; resultArrayString has @"["abcd"]"
  3. when the callback needs to be executed in which i have to update the label in html with this string, it goes for a toss. Can u please help.

ggthedev avatar Sep 20 '13 10:09 ggthedev