Realm Swift - 在switch中未处理枚举值'connect_timeout'和'bad_timestamp'

时间:2018-06-05 21:59:57

标签: swift realm

我刚刚通过cocoapods更新到Xcode 9.4(Swift 4.1)和Realm 3.6.0。我第一次收到编译器“语义问题”警告:

  

在switch

中未处理枚举值'connect_timeout'和'bad_timestamp'

我已经清理了build文件夹并重新构建,但没有运气。警告仍然存在。有什么想法吗?

编辑:我应该提到警告是在Realm Framework中。具体来说,sync_session.cpp:

switch (static_cast<ClientError>(error_code.value())) {
        case ClientError::connection_closed:
        case ClientError::pong_timeout:
            // Not real errors, don't need to be reported to the binding.
            return;
        case ClientError::unknown_message:
        case ClientError::bad_syntax:
        case ClientError::limits_exceeded:
        case ClientError::bad_session_ident:
        case ClientError::bad_message_order:
        case ClientError::bad_progress:
        case ClientError::bad_changeset_header_syntax:
        case ClientError::bad_changeset_size:
        case ClientError::bad_origin_file_ident:
        case ClientError::bad_server_version:
        case ClientError::bad_changeset:
        case ClientError::bad_request_ident:
        case ClientError::bad_error_code:
        case ClientError::bad_compression:
        case ClientError::bad_client_version:
        case ClientError::ssl_server_cert_rejected:
        case ClientError::bad_file_ident:
        case ClientError::bad_client_file_ident:
        case ClientError::bad_client_file_ident_salt:
            // Don't do anything special for these errors.
            // Future functionality may require special-case handling for existing
            // errors, or newly introduced error codes.
            break;
    }

1 个答案:

答案 0 :(得分:1)

尝试在&#34; break&#34;之前添加两行:

case ClientError::connect_timeout:
case ClientError::bad_timestamp: