Note that there are some explanatory texts on larger screens.

plurals
  1. POCocoa-Touch, Core Data: Linker error, NSManagedObject symbol not found
    text
    copied!<p>I have a cocoa-touch app, using the core data framework.</p> <p>I've created a xcdatamodel with two entities: <code>Program</code> and <code>ProgramReplay</code>.<br> <code>ProgramReplay</code> has a relationship to <code>Program</code>, and a reverse relationship exists in the later.</p> <p>I've saved this, and used XCode's feature to generate the classes for these two entities. The generated headers are as follows:</p> <pre><code>#import &lt;CoreData/CoreData.h&gt; @class ProgramReplay; @interface Program : NSManagedObject { } // other properties here, removed them to keep it short @property (nonatomic, retain) NSSet* replays; @end @interface Program (CoreDataGeneratedAccessors) - (void)addReplaysObject:(ProgramReplay *)value; - (void)removeReplaysObject:(ProgramReplay *)value; - (void)addReplays:(NSSet *)value; - (void)removeReplays:(NSSet *)value; @end </code></pre> <p>and</p> <pre><code>#import &lt;CoreData/CoreData.h&gt; @class Program; @interface ProgramReplay : NSManagedObject { } @property (nonatomic, retain) NSDate * date; @property (nonatomic, retain) Program * program; @end </code></pre> <p>I haven't started using these two classes anywhere yet, but when I try to build them I get the following weird linking errors:<br> <code>".objc_class_name_NSManagedObject", referenced from:<br> .objc_class_name_Program in Program.o<br> .objc_class_name_ProgramReplay in ProgramReplay.o<br> ld: symbol(s) not found<br> collect2: ld returned 1 exit status</code></p> <p>What am I doing wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload