My javascript function needs this type of array:
var data = [{
"sale": "202",
"year": "2000"
}, {
"sale": "215",
"year": "2002"
}, {
"sale": "179",
"year": "2004"
}, {
"sale": "199",
"year": "2006"
}, {
"sale": "134",
"year": "2008"
}, {
"sale": "176",
"year": "2010"
}];
I want to pass this array as an argument from [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"js_func(%@, %@)", y1Arr, y2Arr]];
I am passing array of dictionary with this format:
({
x = "663.78";
y1 = "-0.000";
},
{
x = "663.88";
y1 = "0.005";
},
{
x = "663.98";
y1 = "0.019";
},
{
x = "664.08";
y1 = "-0.001";
}
)
But its not working...
[]instead of()in your last snippet to make it an array. Oh and what is "not working"?