Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Mar 7, 2009, 05:56 PM   #1
macrumors newbie
Join Date: Mar 2009
bridging javascript events to obj-c - performance


I'm developing for iphone and android using phonegap. ( http://phonegap.com )
my app needs some objective-c <-> Javascript bridging to pass gestureevents
back and forth, because i need certain obj-c code to do effects when a user has
clicked on a certain html element.

what i found out so far is that the method of using
document.location="gap:commandarams" for executing native code from
javascript is very very slow. (e.g. my obj-c code gets called once a
has anyone made any *different experiences?
is there some way to speed this technique up in a serious way?

my 2nd approach is to "inject" a JS object und funcs from obj-c
with stringByEvaluatingJavaScriptFromString , push js-event data into
an JS array
and read that data back form obj-c via [self performSelector:@selector
(readJavascriptLogger) withObject:nil afterDelay:0.1] every 0.1 secs
as described here in the 1st comment:
this works a lot better, but still is not as fast as i would like it
to be.
does this technique has some serious drawbacks?
is there any better way to this kind of javscriptEvent->objc bridging?
is there any way to generally boost JS performance on the iphone?

your help is much appreciated!
seggenhuber is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Apple Looking to Boost Safari JavaScript Performance with New Accelerator Upgrades MacRumors MacRumors.com News Discussion 103 May 15, 2014 10:03 AM
Bridging a internet connection to a router theslaz MacBook Pro 0 May 7, 2014 01:50 PM
10.9 IP over Thunderbolt bridging - Fast! fortysomegeek OS X Mavericks (10.9) 44 Apr 15, 2014 06:19 PM
iPhoto - Creating 'Events' within 'Events'? Big Stevie Mac Applications and Mac App Store 47 Aug 26, 2013 02:30 PM
iPhone 5 - Bridging yet again? FatMax iPhone 43 Oct 11, 2012 08:25 AM

Forum Jump

All times are GMT -5. The time now is 08:51 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC