I just started following the Core Data Tutorial for iOS and wanted to apply Core Data to an existing project. I got up to a point where I was init-ing my NSManagedObjectModel. I started to get some errors that didn’t make sense right away.
Automatic Reference Counting Issue
Receiver ‘NSManagedObjectModel’ for class message is a forward declaration
I discovered that this error really means I’m missing an #import of some CoreData stuff. To fix the problem I simply add the following line to /Supporting Files/projectName-Prefix.pch.
#import <CoreData/CoreData.h>
Advertisement