Swift:通过whatsapp分享mp3文件

时间:2015-04-01 16:48:00

标签: xcode swift whatsapp

我尝试通过whatsapp从我的应用程序共享音频文件,但xcode显示错误:

var controller      = UIDocumentInteractionController()

    if UIApplication.sharedApplication().canOpenURL(NSURL(string:"whatsapp://app")!) {

        var savePath = NSBundle.mainBundle().pathForResource("test", ofType:"mp3")

        controller          = UIDocumentInteractionController(URL:NSURL(fileURLWithPath:savePath!)!)
        controller.UTI      = "net.whatsapp.audio"
        controller.delegate = self
        controller.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)

    } else {
       println("error")
    }

***由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:' - [__ NSCFTimer _openDocumentWithApplication:]:无法识别的选择器发送到实例0x17417c980'

0 个答案:

没有答案
相关问题