@IBAction func shareMeme(sender: UIbarbuttonItem) { let newMeme = save() let memedImage = newMeme.memedImage let activityVIEwController = UIActivityVIEwController(activityItems: [memedImage],applicationActivitIEs: nil) presentVIEwController(activityVIEwController,animated: true,completion: nil) activityVIEwController.completionWithItemsHandler = {(type: String!,completed: Bool,returnedItems: [AnyObject]!,error: NSError!) -> VoID in dispatch_async(dispatch_get_main_queue()){ self.presentingVIEwController?.dismissVIEwControllerAnimated(true,completion: nil) } }}
我不断收到编译器错误“无法分配类型的值'(String!,Bool,[AnyObject]!,NSError!) – > VoID’到’UIActivityVIEwControllerCompletionWithItemsHandler?’”类型的值,引用下面的代码行…
activityVIEwController.completionWithItemsHandler = {(type: String!,error: NSError!) -> VoID in
任何建议,将不胜感激.
@H_419_22@解决方法 你的类型签名与UIActivityVIEwControllerCompletionWithItemsHandler的定义不匹配,它是(String?,[AnyObject] ?,NSError?) – >虚空.用?s替换你的!它应该可以正常工作. 总结以上是内存溢出为你收集整理的ios – 无法分配类型'(String!,Bool,[AnyObject]!,NSError!) – > Void的值为UIActivityViewControllerCompletionWithItemsHandler类型的值?’全部内容,希望文章能够帮你解决ios – 无法分配类型'(String!,Bool,[AnyObject]!,NSError!) – > Void的值为UIActivityViewControllerCompletionWithItemsHandler类型的值?’所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)