Now I want to transform a Array from object_c to javascript, just like label1 , label2 , label3... in the array. I use this method :
WebScriptObject* win = [webview windowScriptObject];
NSMutableArray *nameArray; // in this have some file name : label1,label2...
[win callWebScriptMethod:@"transArray" withArguments:nameArray];
and then in the javascript I var a array and implement a func:
var labelArray= []; // maybe var labelArray = new Array (%@);but it didn't work
function transArray(param)
{
for(var i=0;i < param.length;i++)
labelArray[i] = param[i];
}
then I found that the labelArray isn't like I want. it just like : labelArray[0] = l,labelArray[1] = a; labelArray[2] = b
..... .I thought maybe I could var labelArray = new Array (%@)
.but it didn't work. I don't know the javascript clearly , and if I can transform a array from object_c to javascript or not , how to do ? thanks!