I can call js from obj-c from the phonegap plugin classes and the main
app delegate class as follows:
[webView stringByEvaluatingJavaScriptFromString:@"alert('Hello');"];
You can do this because the webView object can be handled by the
phonegap plugin classes and the phonegap main app delegate.
However I am integrating Openfeint and it has many of its own classes.
When I try the above code in an Openfeint delegate class it doesn't
work because the Openfeint delegate classes can't get a handle on the
webView object.
Can anyone tell me how to do this? I've tried messing with the class
interfaces and importing .h files in various places but nothing seems
to be working. Obviously webView is sitting there somewhere.
I am hacker of obj-c as opposed to someone who really understands it.
I have gotten achievements and leaderboards working for my app. This
is relatively straight forward.
USers can also create and send new challenges.
But I cannot get users who receive these challenges to play them
because of the problem above (at least that's my theory).
I'll share all my Openfeint know how once I get this problem sorted
and release my app.
Cheers
Nigel
以上就是calling js from obj-c openfeint的详细内容,更多请关注web前端其它相关文章!