【发布时间】:2016-01-30 10:23:12
【问题描述】:
错误是“无法将类型'[AnyObject]'的值转换为预期的参数类型'[String]?'”。有谁知道如何解决这个问题?
func send() {
let picker = MFMailComposeViewController()
picker.mailComposeDelegate = self
picker.setSubject(subject.text!)
//the code below is the reason I got error for
picker.setToRecipients(Const.CONTACT_MAIL)
picker.setMessageBody(body.text, isHTML: true)
presentViewController(picker, animated: true, completion: nil)
}
【问题讨论】:
-
你的代码中的 Const 是什么?
-
这一行需要预期的类型Const.CONTACT_MAIL
-
你应该只传递字符串
-
喜欢(Const.String)?代码应该是什么样子?