xcode - Swift: share mp3 file via whatsapp -
i try share audio file app via whatsapp, xcode shows error:
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") }
*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscftimer _opendocumentwithapplication:]: unrecognized selector sent instance 0x17417c980'
Comments
Post a Comment