Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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. ( )
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Slide To Run - (by 42Games) - FREE!! - Universal App Lakoo iPhone and iPod touch Apps 1 Aug 3, 2011 05:55 AM
Back to Mac - Its working Appleind Mac OS X 10.7 Lion 2 Jul 24, 2011 01:46 PM
FW800 to eSATA - performance jump likely to be worthwhile? norliss MacBook Pro 6 Jan 30, 2011 12:18 AM
Adding events to calendar - default calendar for entry macabouttobe iPhone Tips, Help and Troubleshooting 1 Apr 9, 2009 04:40 PM
Javascript events problem TheReef Web Design and Development 6 Oct 7, 2007 09:07 AM

All times are GMT -5. The time now is 01:33 AM.

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

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC