Search code examples
objective-ciosxcodecore-databuild-process

NSManagedObject is undefined?


I was working in a seemingly unrelated area of my Xcode project when I started getting this build error:

Error Screenshot

It seems that NSManagedObject is undefined. The core data framework is still in my project and included in the link phase of the build process.

If I change Record to be a subclass of NSObject, the errors go away, so it must have something to do with Core Data or the way that it's included in my project. I didn't change anything having to do with the framework when this started occurring, however.

Any ideas about what could be going on here?!

Thanks!


Solution

  • someone on the Apple Dev Forums helped me solve this one. I was indeed missing a @end, but it had nothing to do with this header file. It was in a completely unrelated header file, one that didn't import Record. It imported a class that itself imports Record . . . anyway, little point in guessing about why the compiler came up with the error that it did.

    The solution was (obviously) to look through my header files and find the one that was actually missing a @end after the @interface declaration. In retrospect, it seems rather obvious.