user1698875 user1698875 - 7 months ago 56
Objective-C Question

Objective C, Core Data Fetch Request

I am updating an app to included a toolbar item that totals items. My fetch request is generating an error.

NSArray *resultsArray = [self.managedObjectContext executeRequest:fetchRequest error:&error];

The error is: Incompatible pointer types initialising 'NSArray ' with an expression of type '_kindof NSPersistentStoreResult _Nullable'

I believe I saw something about Objective C updates that deals with Nullable but cannot work out how to modify the NSArray statement.

Can someone point me in the right direction?


It's not the nullability updates-- it's that you're calling the new-ish executeRequest:error: when it looks like you want to call executeFetchRequest:error: