estoy tratando de llamar a una función JavaScript desde un archivo HTML local cargada en UIWebView
pero deosn't responderstringByEvaluatingJavaScriptFromString no funciona
se vea así
NSString *script=[NSString stringWithFormat:@"sample()"];
if (tekst.loading) {
NSLog(@"Loading");
} else {
NSLog(@"Fully loaded");
[tekst stringByEvaluatingJavaScriptFromString:script];
}
y en html
<head>
....
<script type='text/javascript'>
function sample() {
alert('Paznja');
}
</script>
...
</head>
Sin relación con su pregunta, pero no hay necesidad de llamar 'stringWithFormat:' aquí. Simplemente asigne el literal de cadena directamente: NSString * script = @ "sample()"; – highlycaffeinated