作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我刚刚通过 cocoapods 更新到 Xcode 9.4 (Swift 4.1) 和 Realm 3.6.0。我第一次收到编译器“语义问题”警告:
Enumeration values 'connect_timeout' and 'bad_timestamp' not handled in switch
我已经清理了构建文件夹并重新构建,但没有成功。警告仍然存在。有什么想法吗?
编辑:我应该提到警告在 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;
}
最佳答案
尝试在“break”前加两行:
case ClientError::connect_timeout:
case ClientError::bad_timestamp:
关于swift - Realm Swift - 枚举值 'connect_timeout' 和 'bad_timestamp"未在开关中处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50709544/
我是一名优秀的程序员,十分优秀!