-
Notifications
You must be signed in to change notification settings - Fork 38
Description
I create a ZIMOrmModel named Group:
@interface Group : ZIMOrmModel {
@Protected
NSNumber *_pk;
NSString *_group_name;
NSNumber *_position;
}
@Property (nonatomic,retain) NSNumber *pk;
@Property (nonatomic,retain) NSString *group_name;
@Property (nonatomic,retain) NSNumber *position;
// create a new group:
Group *g = [[Group alloc]init];
[g setGroup_name:@"group name"];
[g setPosition:[NSNumber numberWithInt:1]];
[g save];
Column name has prefix "_", then function raise an exception on:
if ([columnName hasPrefix: @"_"]) {
columnName = [columnName substringWithRange: NSMakeRange(1, [columnName length])];
}
because NSMakeRange raise an NSRangeException : Range or index out of bounds.
It work for me to change this line with:
columnName = [columnName substringWithRange: NSMakeRange(1, [columnName length] -1)];
or
columnName = [columnName substringFromIndex:1];
Regards,
g.