Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
How can I access an objc variable (say an integer) from the javascript-code of a html-page within a uiwebview?

Is it even possible?
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
There is very little documentation on it, and no examples to mimic/alter.

Was your solution to call the javascript and pass along the variabel as a parameter?

Pseudocode:
Code:
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)myJSFunction(returnParameter)
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Alright, Im getting somewhere - thanks for your help :)

Finally, just let me get this straight: in the code you substitute the %d with var?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.