我在代码中收到此警告,但无法弄清楚它的含义以及需要解决的问题。该警告内容如下:
“ return”之后的表达式被视为“ return”的参数
它显示在此行上:
// Tell Realm to use this new configuration object for the default Realm
Run Code Online (Sandbox Code Playgroud)
有人可以解释我在做什么错吗?参见下面的代码部分。
一些背景信息,该代码是数据库管理器类的一部分,如果加密的数据库尚不存在,我可以使用该类将未加密的领域数据库迁移到加密的领域数据库。如果已加密的数据库已经存在,则它将领域配置为使用该默认数据库。如果无法打开它(例如由于加密密钥错误),它将创建一个新数据库。
let exists = self.encryptedDatabaseExists(config)
if exists {
//Try to open Realm with new config. If unsuccessful, it needs to be removed and a new one created
do {
_ = try RLMRealm(configuration: config)
// Tell Realm to use this new configuration object for the default Realm
RLMRealmConfiguration.setDefaultConfiguration(config)
RLMRealm.defaultRealm()
} catch let err {
Log.error("Encrypted DB could not be opened: \(err)") …Run Code Online (Sandbox Code Playgroud) 我有一个白标记的应用程序,每个客户的应用程序都有自己唯一的捆绑标识符.这导致Crashlytics涌入不同的应用程序,可能会有相同的崩溃报告.我希望将它全部归为一个应用程序,因此更容易维护.
我知道Android有一个解决方案(https://gist.github.com/tyvsmith/6188014),但找不到iOS的任何内容.
有没有人知道这是否可以用于iOS,如果可以,我该怎么做?