iOS 8 JavaScriptCore: Where do you place your JavaScript files at?
问题 How do you add a JS file to the home directory so that 's' does not return 'nil'. Thanks. func analyzeText(text: String) { let homeDir = NSHomeDirectory() var err: NSError? = NSError() let s = String(contentsOfFile: homeDir + "/text.js", encoding: NSUTF8StringEncoding, error: &err) println(s) var context = JSContext(virtualMachine: JSVirtualMachine()) context.evaluateScript(s) let analyzeText = context.objectForKeyedSubscript("analyzeText") let analyzeTextVal = analyzeText.callWithArguments(