workaround for iOS 10 regression in "affectedStores" retain bug

This commit is contained in:
John Estropia
2016-09-09 13:09:13 +09:00
parent 3f28198552
commit 0fa2a23461

View File

@@ -49,14 +49,13 @@ internal final class CoreStoreFetchRequest<T: NSFetchRequestResult>: NSFetchRequ
get {
return super.affectedStores
// let affectedStores: NSArray? = super.affectedStores.flatMap({ NSArray(array: $0) } )
// return affectedStores as? [NSPersistentStore]
// This forced-casting is needed to fix an ARC bug with "affectedStores" mis-retaining the array
let affectedStores: NSArray? = super.affectedStores.flatMap({ NSArray(array: $0) } )
return affectedStores as? [NSPersistentStore]
}
set {
super.affectedStores = newValue
// super.affectedStores = newValue.flatMap(Array.init)
}
}
}