"BBImage" is not a subclass of NSManagedObject in ios9

127 Views Asked by At

When I use coredata in my project everything is ok before ios9. the code is like this

@interface BBImage : NSManagedObject

    @property (nonatomic, retain) NSDate * create_date;
    @property (nonatomic, retain) NSString * data_path;
    @property (nonatomic, retain) NSNumber * height;
    @property (nonatomic, retain) NSString * key;
    @property (nonatomic, retain) NSNumber * width;

@end

but when i run it in ios9 , i get an error :"BBImage" is not a subclass of NSManagedObject. I didnot know what should i do to reslove it. I've used previous versions of the class name, if I change the class name version of the data will be lost before.

1

There are 1 best solutions below

0
On

Another class BBText can work on ios9,ios8,ios7,ios6

    @interface BBText : NSManagedObject
            @property (nonatomic, retain) NSDate * create_date;
            @property (nonatomic, retain) NSString * font;
            @property (nonatomic, retain) NSNumber * fontsize;
            @property (nonatomic, retain) NSDate * modify_date;
            @property (nonatomic, retain) NSString * text;
            @property (nonatomic, retain) NSString * text_color;
    @end