diff --git a/Source/AccessCodeGenerator.m b/Source/AccessCodeGenerator.m index 704de28..2a0953a 100644 --- a/Source/AccessCodeGenerator.m +++ b/Source/AccessCodeGenerator.m @@ -148,16 +148,22 @@ + (NSString *)getterWithPSProperty:(PSProperty *)model + (NSString *)setterWithPSProperty:(PSProperty *)model { NSString *setter = @""; + if (model.name.length < 1) { + return setter; + } + + NSString *firstLetter = [model.name substringToIndex:1]; + NSString *name = [model.name stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:firstLetter.uppercaseString]; if (model.isObjectType) { setter = [NSString stringWithFormat:@"\n- (void)set%@:(%@ *)%@ {\n _%@ = %@;\n}", - [model.name capitalizedString], + name, model.dataType, model.name, model.name, model.name]; } else { setter = [NSString stringWithFormat:@"\n- (void)set%@:(%@)%@ {\n _%@ = %@;\n}", - [model.name capitalizedString], + name, model.dataType, model.name, model.name,