I am trying to pass a array of date values from Objective C to Javascript. I tried to pass it this way -
In my Javascript -
However, what happens here is that the value get displayed as -2, -4, -6, -8, -10 . It literally does a subtraction operation on the values.
Would someone be able to help me out with how I can get this working?
Code:
NSArray *array = [NSArray arrayWithObjects:@"01-03",@"01-05",@"01-07",@"01-09",@"01-11", nil];
self.dateString = [array componentsJoinedByString:@","];
[wtWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"methodName([%@])", dateString]];
In my Javascript -
Code:
<script>
function methodName(val,val1)
{
alert(val1);
}
</script>
However, what happens here is that the value get displayed as -2, -4, -6, -8, -10 . It literally does a subtraction operation on the values.
Would someone be able to help me out with how I can get this working?