【发布时间】:2017-01-13 03:13:31
【问题描述】:
当用户点击我的小部件时,我正在尝试启动我的应用程序。
这是我的代码:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
let myAppUrl = NSURL(string: "Sleep-Analysis")!
extensionContext?.open(myAppUrl as URL, completionHandler: { (success) in
if (!success) {
print("error") }
})
}
但应用程序没有启动,但给了我这个错误。
2017-01-13 09:36:23.921768 Sleep Timer Widget[10365:3109526] __55-[_NCWidgetExtensionContext openURL:completionHandler:]_block_invoke failed: Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
我已经在项目的 info.plist 和 info 部分设置了 URL 方案。
我可能做错了什么,但这里是 info.plist 的屏幕截图
这是我的项目信息部分。
【问题讨论】:
-
你找到问题了吗?我目前遇到完全相同的问题:(
标签: ios swift swift3 xcode8 today-extension