Sunday, 13 March 2011

Passing date value from objective C to Javascript


i trying pass array of date values objective c javascript. tried pass way -
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 javascript -
code:
<script>  function methodname(val,val1)     {        alert(val1);     }  </script>
however, happens here value displayed -2, -4, -6, -8, -10 . literally subtraction operation on values.

able me out how can working?
 



Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment