我刚刚从
Xcode 6 Beta 3升级到Beta 4.在3我的应用程序完美编译然而在4我有以下错误.任何人都可以解释并提供解决方案.
func messageComposeViewController(sendMsg: MFMessageComposeViewController,didFinishWithResult result: MessageComposeResult) {
switch result {
case MessageComposeResultSent : //Error: MessageComposeResult is not convertible to _OptionalNilComparisonType
label2.text = "Msg Sent"
case MessageComposeResultCancelled : //Error: MessageComposeResult is not convertible to _OptionalNilComparisonType
label2.text = "Msg Send Cancelled"
case MessageComposeResultFailed : //Error: MessageComposeResult is not convertible to _OptionalNilComparisonType
label2.text = "Msg Send Failed"
default:
label2.text = "Msg Error"
}
self.dismissViewControllerAnimated(true,completion: nil)
self.reloadInputViews()
}
解决方法
这是该模块与Swift桥接的方式中的一个错误.报告.要使用该模块,请保持Objective-C直到修复Swift桥接错误.
在我看来,bug的主要部分似乎是:
>这应该是一个枚举,而不是;这是一个结构> struct有一个值,它应该能够进行比较,但它没有getter(你可以在初始化时设置它但你以后不能得到它)