xcode 6 beta 4 - MessageComposeResult不能转换为OptionalNilComparisonType [英] xcode 6 beta 4 - MessageComposeResult is not convertible to OptionalNilComparisonType

查看:99
本文介绍了xcode 6 beta 4 - MessageComposeResult不能转换为OptionalNilComparisonType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从Xcode 6 Beta 3升级到Beta 4.在3我的应用程序完美编译然而在4我有以下错误。任何人都可以解释并提供解决方案。

I have just upgraded from Xcode 6 Beta 3 to Beta 4. In 3 my app was compiling perfectly however in 4 I have the following error. Can anyone explain and provide a solution please.

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桥接错误。

It's a bug in the way this module is bridged to Swift. Report it. To use the module, stay in Objective-C until the Swift bridging bug is fixed.

我认为这个bug的主要部分似乎是:

The main part of the bug as it stands seems to me to be:


  • 这应该是枚举,而不是;它是一个结构

  • This should be an enum, and it isn't; it's a struct

该结构具有,它应该能够进行比较,但它没有getter(你可以在初始化时设置它但你以后不能得到它)

The struct has a value, which ought to be capable of comparison, but it has no getter (you can set it on initialization but you can't get it later)

这篇关于xcode 6 beta 4 - MessageComposeResult不能转换为OptionalNilComparisonType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆