Reputation: 47
IS it possible to get a array of strings from Javascript. I mean I am calling javascript in my code for iPhone app. Now After the functions completes I want to return the array of string to the objective C code back. How can I return the array back and how my objective-c code can read that array?
Thanks Akansha
Upvotes: 1
Views: 2052
Reputation: 3051
Here's a more direct way to do it. Call JSON.stringify
on the JSON
object to be returned from your function. Then convert that string to an NSDictionary, something similar to this.
Upvotes: 1
Reputation: 6268
You have to use webview's
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
delegate method. See my answer here.
iOS UIWebView Javascript - insert data -receive callbacks?
UPDATE FOR COMMENT:
and this one,
Upvotes: 1