我正在使用 MyScript Interactive ink SDK 来转换手写数学方程。我使用他们拥有的测试示例测试了 SDK,一切都很好。我将他们的许多代码逻辑导入到我的应用程序中,并且能够成功设置引擎和编辑器。我可以编写项目,甚至可以在编辑器中使用重做、清除和撤消项目。问题是每次我试图隐藏它时,它都会返回一个“?”。
要转换的函数如下所示,与 MyScript 提供的示例中的代码完全相同 -
@IBAction func ConvertButtonWasTouchedUpInside(_ sender: UIBarButtonItem) {
do {
editorViewController.editor.waitForIdle()
let supportedTargetStates = editorViewController.editor.getSupportedTargetConversionState(nil)
try editorViewController.editor.convert(nil, targetState: supportedTargetStates[0].value)
} catch {
print("Error while converting : " + error.localizedDescription)
}
do
{
try equationInLatex = editorViewController.editor.export_(nil, mimeType: .laTeX)
}
catch
{
print("Error while printing : " + error.localizedDescription)
}
print(equationInLatex)
}
在 AppDelegate.swift 文件中为引擎创建包的代码和在引擎中设置的代码也是相同的。
我附上了一张关于返回值的图片
像这儿
我无法弄清楚为什么我会遇到此错误以及引擎和/或编辑器设置的哪一部分我做错了。
谢谢你!