core data 字段类型为integer 16就挂掉,该如何解决

core data 字段类型为integer 16就挂掉
添加的代码

- (void)addLog:(DataLog*)data
{
    dataLog = [NSEntityDescription insertNewObjectForEntityForName:DATALOG inManagedObjectContext:content];
    dataLog.day = 123;
    if (dataLog != nil) {
        BOOL result = [content save:nil];
        if (result) {
            NSLog(@"添加成功");
        }else{
            NSLog(@"添加失败");
        }
    }else{
        NSLog(@"失败1");
    }
    
}



day字段如果是string就不会报错,如果改成integer 16就挂掉。

请问是数据类型的问题吗?
------解决方案--------------------
看你对象里定得类型吧?