mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-24 10:21:40 +01:00
iOS 11 fixed the NSFetchRequest.affectedStores bug
This commit is contained in:
committed by
John Estropia
parent
3e00a3da06
commit
2912dcf010
@@ -235,15 +235,16 @@ CSWhere *_Nonnull CSWherePredicate(NSPredicate *_Nonnull predicate) CORESTORE_RE
|
|||||||
|
|
||||||
- (void)setAffectedStores:(NSArray<NSPersistentStore *> *_Nullable)affectedStores {
|
- (void)setAffectedStores:(NSArray<NSPersistentStore *> *_Nullable)affectedStores {
|
||||||
|
|
||||||
// Bugfix for NSFetchRequest messing up memory management for `affectedStores`
|
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
|
||||||
// http://stackoverflow.com/questions/14396375/nsfetchedresultscontroller-crashes-in-ios-6-if-affectedstores-is-specified
|
if ([processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){ 11, 0, 0 }]
|
||||||
|
|| ![processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){ 10, 0, 0 }]) {
|
||||||
if (NSFoundationVersionNumber < NSFoundationVersionNumber10_0) {
|
|
||||||
|
|
||||||
self.safeAffectedStores = affectedStores;
|
self.safeAffectedStores = affectedStores;
|
||||||
[super setAffectedStores:affectedStores];
|
[super setAffectedStores:affectedStores];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Bugfix for NSFetchRequest messing up memory management for `affectedStores`
|
||||||
|
// http://stackoverflow.com/questions/14396375/nsfetchedresultscontroller-crashes-in-ios-6-if-affectedstores-is-specified
|
||||||
if (self.releaseArray != NULL) {
|
if (self.releaseArray != NULL) {
|
||||||
|
|
||||||
CFRelease(self.releaseArray);
|
CFRelease(self.releaseArray);
|
||||||
|
|||||||
Reference in New Issue
Block a user