Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 插件com.apple.share.Mail.compose无效(Cocoa NsharingServiceNameComposeEmail)_Swift_Cocoa_Xcode7.3 - Fatal编程技术网

Swift 插件com.apple.share.Mail.compose无效(Cocoa NsharingServiceNameComposeEmail)

Swift 插件com.apple.share.Mail.compose无效(Cocoa NsharingServiceNameComposeEmail),swift,cocoa,xcode7.3,Swift,Cocoa,Xcode7.3,在我的Cocoa应用程序中,我有一个用于发送电子邮件的按钮: @IBAction func emailFeedBack(sender: NSButton) { sender.enabled = false //mail composition let subject = "[Feedback]" let body = "\n\n\nFeedback From my app:\n" let service = NSSharingService(named:

在我的Cocoa应用程序中,我有一个用于发送电子邮件的按钮:

@IBAction func emailFeedBack(sender: NSButton) {
    sender.enabled = false

    //mail composition
    let subject = "[Feedback]"
    let body = "\n\n\nFeedback From my app:\n"
    let service = NSSharingService(named: NSSharingServiceNameComposeEmail)
    service?.delegate = self
    service?.recipients = ["myMail@mail.com"]
    service?.subject = subject
    let shareItems = [body] as NSArray
    service?.performWithItems(shareItems as [AnyObject])

    //activate the button after 1 sec
    let delayTime = (Int64(NSEC_PER_SEC) * 1)
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delayTime),
                   dispatch_get_main_queue(), { () -> Void in
                    sender.enabled = true
    })
}
它可以正常工作并按预期启动邮件应用程序。但是,我在调试控制台上收到以下消息:

插件com.apple.share.Mail.compose无效


有人知道如何解决这个问题吗?

我对obj-c项目也有同样的问题。我认为这并不重要,因为一切都正常。我对obj-c项目也有同样的问题。我认为这并不重要,因为一切都正常。