我试图加载一个文件,我已保存为我的iOS内容拦截器,但我一直得到此日志,它不会工作。这是我得到的代码和日志,有人能帮我找到问题吗?
谢谢
可选(Error Domain=NSCocoaErrorDomain Code=4097“连接到名为com的服务。apple.SafariServices.ContentBlockerLoader”UserInfo={NSDebugDescription=连接到名为com的服务。apple.SafariServices.ContentBlockerLoader})
import UIKit
import MobileCoreServices
class ActionRequestHandler: NSObject, NSExtensionRequestHandling {
func beginRequestWithExtensionContext(context: NSExtensionContext) {
let attachment = NSItemProvider(contentsOfURL: NSBundle.mainBundle().URLForResource("blockerList", withExtension: "json"))!
let item = NSExtensionItem()
item.attachments = [attachment]
if let urlToFile = BlackListManager.sharedInstance.urlToFile(), userFile = NSItemProvider(contentsOfURL: urlToFile) {
item.attachments = [userFile]
}
print(item.attachments)
context.completeRequestReturningItems([item], completionHandler: { expired in
print("%@", expired)
})
}
}
1条答案
按热度按时间sbtkgmzw1#
取消选中方案中的代码覆盖率,然后工作。