I have a webpage. I have a javascript file that does a whole lot of stuff. In the app I have an NSString with some crucial data that needs to be processed in the javascrip
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
sounds like exactly the method you need. If, for example, the input and output need to interact with the JavaScript can be done with a single method, you can pass a value into JavaScript and get the results with something like the following code:
NSString* jsCode = [NSString stringWithFormat:@"doSomething('%@')", dataToPass];
NSString* resultFromJavaScript = [webView stringByEvaluatingJavaScriptFromString:jsCode];