I have two main data models with int64_t properties. One of them works fine, and the other throws EXC_BAD_ACCESS when I try to assign a nonzero value to an integer field. I read the answers that say to recreate the NSManagedObject child class, and I did this without success. A broken class is as follows:
@interface NoteObject : NSManagedObject @property (nonatomic) int64_t remoteID; @property (nonatomic) int64_t remoteArticleID; @property (strong, nonatomic) ArticleObject *article; @property (strong, nonatomic) NSString *status; @property (strong, nonatomic) NSString *token; @property (strong, nonatomic) NSString *title; @property (strong, nonatomic) NSString *noteContent; @property (strong, nonatomic) NSDate *pubDate; @property (strong, nonatomic) NSDate *modDate; @end @implementation NoteObject @dynamic remoteID; @dynamic remoteArticleID; @dynamic article; @dynamic status; @dynamic token; @dynamic title; @dynamic noteContent; @dynamic pubDate; @dynamic modDate; @end
The violation line is in this block:
_noteObject = [NSEntityDescription insertNewObjectForEntityForName:@"Note" inManagedObjectContext:self.managedObjectContext]; _noteObject.remoteArticleID = 0;
What really puzzled me was that in another model, I have the same fields with the same types, and they will receive non-zero values ββwithout problems:
bookmarkObject = [NSEntityDescription insertNewObjectForEntityForName:@"Bookmark" inManagedObjectContext:self.managedObjectContext]; bookmarkObject.remoteArticleID = 0;
Is there anything in my .xcdatamodeld file that can cause this?
EDIT
My data models are as follows:


source share