Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Diary App Using Core Data Understanding Core Data Typical Core Data Stack

All NSManagedObject... references display errors.

I'm using Xcode 6.1.1 and iOS 8. When I create the Diary project, I do not have the option to create an empty application, so I have used the Single Application. Immediately, I get 18 errors complaining about all references to every project/method in both .h & .m throws an error that starts with NS.

Unknown type name 'NSManagedObjectContext' Property with 'retain or (strong)' must be an object type etc.

I haven't even tried to do anything else beyond the initial Diary project creation.

Any ideas or help would be greatly appreciated.

Tayyab Hanif
Tayyab Hanif
3,601 Points

hey ! Im having same issue. did u happen to come across solution to this ?

2 Answers

Just cut and paste #import <CoreData/CoreData.h> from AppDelegate.h file into THCoreDataStack.h file. Worked for me.

Alexander Unruh
Alexander Unruh
1,997 Points

That worked for me. Thank you!

Thanks, that works.

Darean Wong
PLUS
Darean Wong
Courses Plus Student 4,186 Points

This might sound crazy, but I was having the same problem with cutting and pasting over the mentioned methods from AppDelegate.m and AppDelegate.h on Xcode 6.3.2 . I've imported the CoreData/CoreData.h file and also added the CoreData.framework manually to my project but it didn't work.

Turns out it was some kind of weird parsing issue with my version of Xcode. I had to manually retype the lines that were giving errors and the errors went away one by one.