Undefined Symbol “_OBJC_CLASS_$_NSManagedObject”

I stumbled across this compilation error while adding Core Data support to my latest app-in-progress.

 Undefined symbols for architecture i386:

“_OBJC_CLASS_$_NSManagedObject”, referenced from:

_OBJC_CLASS_$_Show in Show.o

“_OBJC_METACLASS_$_NSManagedObject”, referenced from:

_OBJC_METACLASS_$_Show in Show.o

 

Fortunately, it’s an easy fix – my project was missing the Core Data framework. After adding it and rebuilding, everything was fine.

The ridiculous part, though, is that despite adding a new Core Data model to my project, creating an entity, and generating an NSManagedObject subclass, Xcode wasn’t smart enough to actually add the Core Data framework for me.

I’m gonna let you in on a little secret, Apple. If someone adds a new Core Data model to their project, and then adds an entity, and then generates NSManagedObject subclasses, it’s probably because, you know, they want to use Core Data. So just add the add the stupid framework automatically and save us all some headaches.

By comparison, Visual Studio does it right, and automatically adds the necessary Entity Framework references for you when you add a new Entity Data Model. There is no reason Xcode shouldn’t do it too (aside from Apple’s general apathy towards their developer tools, that is).

One Comment

  1. [url=http://www.okakaku.com/Super-Copy-9577.html]スイス昨年各種経済指標が比較的に理想的で、全国的には喜んで?。しかし、スイス連邦政府の経済最近事務秘書署は、スイス経済最近に遭遇した30年以来の珍しい困難を予測し、国民経済は今年、縮んで2 . 2%、2010年に失業率が5%の上昇があり。[/url]

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *