1

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

2 Answers 2

1

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,

Submit a form in UIWebView

Sign up to request clarification or add additional context in comments.

5 Comments

ok thanks Elanthiraiyan. I wil try this and will get back you.
I saw the link. In that what exactly "clickedOnLineNo" mean? I mean I am not able to get what does "clickedOnLineNo" actually do.
I have added another one of answer. Have a look at that
thanks, this one looks to be more elaborative. I will try this. Thanks a lot for your help. I will inform you if I get my things working. Thanks again !
Thanks a lot. Your help was really awesome. It worked. Thanks you so so much . Elanthiraiyan. :)
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.