I was developing an app, at some stage this error came out:
-[__NSArrayM popObjectForKey:]: unrecognized selector sent to instance
I've undone the latest edits to see what was wrong...but the error was still there. So I've undone even more edits, but the error was still there.
Tried to delete and add back the framework where I thought the error could come from, error still there. (it's KinveyKit framework)
Tried to substitute the line of code where the app would throw the error with another one that was surely working: even that one was throwing the error.
I downloaded an older Git of the app (that was definitely working a few days ago) on a different folder, run that and: same error.
Uninstalled and reinstalled Xcode: error still there.
But: if I run other apps with similar code, nothing goes wrong. Does anybody have any idea?
I post here the code, that throws me the error, just to give you an idea...but I don't think there's anything wrong in the code since it's always been working before.
.h
@property (strong, nonatomic) KCSAppdataStore *store;
.m
- (void)viewDidLoad
{
...
_store = [KCSAppdataStore storeWithOptions:@{ KCSStoreKeyCollectionName : @"AnEntity",
KCSStoreKeyCollectionTemplateClass : [AnEntity class]}];
[_store queryWithQuery:[KCSQuery query]
withCompletionBlock:^(NSArray *objectsOrNil1, NSError *errorOrNil) { ... }];
...
}