From 80984fa1e2d6c047c1550bf131ad5eed446c60db Mon Sep 17 00:00:00 2001 From: YevgenStarikov <124806754+YevgenStarikov@users.noreply.github.com> Date: Wed, 11 Oct 2023 12:19:28 -0700 Subject: [PATCH] Update RKManagedObjectStore.m Fixing the following NEW error: "this class is not key value coding-compliant for the key @count" for iOS 10+ --- Code/CoreData/RKManagedObjectStore.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Code/CoreData/RKManagedObjectStore.m b/Code/CoreData/RKManagedObjectStore.m index 93e680155f..8345d52483 100644 --- a/Code/CoreData/RKManagedObjectStore.m +++ b/Code/CoreData/RKManagedObjectStore.m @@ -52,10 +52,15 @@ static BOOL RKIsManagedObjectContextDescendentOfContext(NSManagedObjectContext * static NSSet *RKSetOfManagedObjectIDsFromManagedObjectContextDidSaveNotification(NSNotification *notification) { - NSUInteger count = [[[notification.userInfo allValues] valueForKeyPath:@"@sum.@count"] unsignedIntegerValue]; - NSMutableSet *objectIDs = [NSMutableSet setWithCapacity:count]; + // fixing the following NEW error: "this class is not key value coding-compliant for the key @count" for iOS 10+ + // NSUInteger count = [[[notification.userInfo allValues] valueForKeyPath:@"@sum.@count"] unsignedIntegerValue]; + // NSMutableSet *objectIDs = [NSMutableSet setWithCapacity:count]; + + NSLog([notification.userInfo allValues]); + NSMutableSet *objectIDs =[NSMutableSet new]; for (NSSet *objects in [notification.userInfo allValues]) { - [objectIDs unionSet:[objects valueForKey:@"objectID"]]; + if ([objects isKindOfClass:NSSet.class]) + [objectIDs unionSet:[objects valueForKey:@"objectID"]]; } return objectIDs; }