Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSManagedObject.h file not found error

Tags:

ios

core-data

My SignupInfo.h

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

@class NSManagedObject;

@interface SignupInfo : NSManagedObject

@property (nonatomic, retain) NSString * firstName;
@property (nonatomic, retain) NSString * lastName;
@property (nonatomic, retain) NSString * sex;
@property (nonatomic, retain) NSString * email;
@property (nonatomic, retain) NSNumber * zipcode;
@property (nonatomic, retain) NSString * password;
@property (nonatomic, retain) NSString * retypepassword;


@end

My SignupInfo.m

#import "SignupInfo.h"
#import "NSManagedObject.h"


@implementation SignupInfo

@dynamic firstName;
@dynamic lastName;
@dynamic sex;
@dynamic email;
@dynamic zipcode;
@dynamic password;
@dynamic retypepassword;

@end

I am getting build error saying NSManagedObject.h file not found

I am using Core data model for SignupInfo

like image 680
yogsma Avatar asked Apr 02 '26 20:04

yogsma


2 Answers

NSManagedObject is defined in a .h file that is included by <CoreData/CoreData.h>. Therefore, you do not need to declare it, and you do not need the #import statement.

Have same issue when I created NSManagedObject subclass in workspace.

Use follow declaration then the problem gone.

#import <CoreData/NSManagedObject.h>
like image 35
OOBE Avatar answered Apr 04 '26 09:04

OOBE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!