File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -900,7 +900,15 @@ void modifyClassNamePrefix(NSMutableString *projectContent, NSString *sourceCode
900900 if ([fileName hasPrefix: oldName]) {
901901 newClassName = [newName stringByAppendingString: [fileName substringFromIndex: oldName.length]];
902902 } else {
903- newClassName = [newName stringByAppendingString: fileName];
903+ // 处理是category的情况。当是category时,修改+号后面的类名前缀
904+ NSString *oldNamePlus = [NSString stringWithFormat: @" +%@ " ,oldName];
905+ if ([fileName containsString: oldNamePlus]) {
906+ NSMutableString *fileNameStr = [[NSMutableString alloc ] initWithString: fileName];
907+ [fileNameStr replaceCharactersInRange: [fileName rangeOfString: oldNamePlus] withString: [NSString stringWithFormat: @" +%@ " ,newName]];
908+ newClassName = fileNameStr;
909+ }else {
910+ newClassName = [newName stringByAppendingString: fileName];
911+ }
904912 }
905913
906914 // 文件名 Const.ext > DDConst.ext
You can’t perform that action at this time.
0 commit comments