我正在使用restKit + 核心数据堆栈。这并不是什么大问题,但它只是让我烦恼。这是我的代码中唯一的警告。 也许我做错了什么。请给我一些方法来平息这一切。
Warning: Immutable value 'persistentStore' was never used; consider replacing with '_' or removing it!
{
let persistentStore: NSPersistentStore?
do {
try persistentStore = managedObjectStore?.addSQLitePersistentStore(atPath: storePath, fromSeedDatabaseAtPath: nil, withConfiguration: nil, options: nil)
} catch {
fatalError("Error migrating store")
}
}
最佳答案
如果您不使用persistentStore
,那么只需:
尝试 _ = ManagedObjectStore?.addSQLitePersistentStore(atPath: storePath, fromSeedDatabaseAtPath: nil, withConfiguration: nil, options: nil)
关于swift - 如何在 Swift 3 中消除警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40426941/