Skip to content

Exception in ZIMOrmModul.m in method "columns" #20

@girardengo

Description

@girardengo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions