I have a UIWebView that utilizes JavaScriptCore.  I'm trying to call an ObjC function from an web page.  However, the function needs to be call asynchronously, so I'm passing in a callback function that is called when the async ObjC function...
We are developing a Cocoa app for Mac OSX (10.8) which needs to use a JavaScript library (long story why we must use JavaScript).  In a demo application everything seemed to be just fine, but while incorporating the code in our project, we can call t...
Given an Node.js module that does not rely on any Node.js functionality except modules (export/require) how do I access its functions from Objective-C or Swift using JS core?   Example "module":  var compute = function compute(number) {   ret...
I'm running into issues while trying to use JSManagedValue. From my understanding based on Session 615 at WWDC 2013, when you want to have a reference from Objective-C to Javascript and vice-versa, you'll need to use JSManagedValue instead of...
I have two JSContexts, and I want to swap JSValues between them from time to time. However, I'm having difficulty moving a JSValue to a new context, if that's possible.  I'm trying this:  newContext[@"newValue"] = [JSValue valueWi...
I've been playing around with the new iOS 7/Mavericks JavascriptCore bridge, trying to get JS functions on Objective-C as blocks.  The JavascriptCore header files states that this is possible as long as every argument is supported, but trying thi...
I am trying to to read local files using jsc. How can I use File API? Although Safari 9.1 on El Capitan supports HTML5 File API, I get the following error with jsc.  $ cat foo.js var f = new FileReader(); $ alias jsc=/System/Library/Frameworks/JavaSc...
Suppose I have three classes.   A view controller with a button present on it. JavaScript file with some JavaScript methods.  Model objective class with some methods of calling web-service.   When I press button on view controller, it calls .js (Java...
I am using javascript in swift. I am using JavaScriptCore for this. I have created a serrated JS file & loading it. Below is code for JS file.  function setOldCities(appCities) {           var city_array = appCities.split(',');   for (var...
I'm writing an iOS/JavaScriptCore app that calls code from a Javascript file. My Javascript code depends on the 'io' variable created by importing socket.io.js. The Javascript all works fine when loaded from an HTML file, but when I load...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.