为什么我的核心数据实体对象未知?

时间:2013-11-18 15:23:42

标签: ios iphone objective-c xcode

当我构建应用程序时,我收到所有CoreData对象类的以下错误:

enter image description here

我确实在Prefix.pch中包含了CoreData库。此外,每次运行构建时,错误的数量从48到62不等。

似乎Xcode根本没有意识到它们是完全定义的。我该如何解决这个问题?

这是头文件:

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "Activities.h"

@class Activities;

@interface Projects : NSManagedObject

@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * information;
@property (nonatomic, retain) NSDate * date;
@property (nonatomic, retain) NSSet *activities;
@end

@interface Projects (CoreDataGeneratedAccessors)

- (void)addActivitiesObject:(Activities *)value;
- (void)removeActivitiesObject:(Activities *)value;
- (void)addActivities:(NSSet *)values;
- (void)removeActivities:(NSSet *)values;

+(NSArray*)retrieveProjects;

-(void)setName:(NSString*)name information:(NSString*) information date:(NSDate *) date;

@end

.m文件:

#import "Projects.h"

@implementation Projects

@dynamic name;
@dynamic information;
@dynamic date;
@dynamic activities;

+(NSArray*)retrieveProjects
{
    //Retrieve all project entries and return as an NSArray here
}

-(void)setName:(NSString*)name information:(NSString*) information date:(NSDate *) date
{
    // Set a Projects object’s attributes;
}

@end

1 个答案:

答案 0 :(得分:1)

尝试将#import“Activities.h”放在.m文件中,也许它的包含问题因为U包括这个.h Activities.h我想