Cocoa -Touch, Core Data: Linker Error, NSManagedObject Symbol Not Found

I have a cocoa -touch application using a basic data structure.

I created xcdatamodel with two objects: Programand ProgramReplay.
ProgramReplayhas to do with Program, and in a later version there is feedback.

I saved this and used the Xcode function to generate classes for these two objects. The generated headers are as follows:

#import <CoreData/CoreData.h>
@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

and

#import <CoreData/CoreData.h>
@class Program;
@interface ProgramReplay :  NSManagedObject  
{
}

@property (nonatomic, retain) NSDate * date;
@property (nonatomic, retain) Program * program;
@end

I have not started using these two classes yet, but when I try to create them, I get the following strange binding errors:
".objc_class_name_NSManagedObject", referenced from:
.objc_class_name_Program in Program.o
.objc_class_name_ProgramReplay in ProgramReplay.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

What am I doing wrong?

+3
source share
1 answer

, CoreData. , "CoreData.framework" " " . #import <CoreData/CoreData.h> .h.

+6

Source: https://habr.com/ru/post/1719822/


All Articles