单击 table 视图使其仅在第一次单击时附加字符串,而不在 didSelectRowAtIndexPath 中再次单击

On click of table view make it append string only on first click and not for another clicks in didSelectRowAtIndexPath

我正在使用 table 视图在 FTP.when 用户输入的文件中导航 url 我正在为 url [=15= 中的单击行附加路径] 第一次点击时效果很好,但当用户再次点击时,双反斜杠得到 added.I 只想为第一次添加反斜杠 click.Is 是否可以添加对另一次点击的检查?希望我清楚 question.please帮助。`

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *      listEntry;
    listEntry = [self.listEntries objectAtIndex:((NSUInteger) indexPath.row) - 1];
    NSString *dict=[listEntry objectForKey:(id) kCFFTPResourceName];
    NSLog(@"dict%@",dict);
    NSString *fvalue = [NSString stringWithFormat:@"/%@/",dict];
    NSLog(@"%@",fvalue);

    NSString  *appendURl=[NSString stringWithFormat:@"%@%@",self.urlText.text,fvalue];

    self.urlText.text=appendURl;


}

通过if else条件处理,并使用hasSuffix,问题解决。`

if ([self.urlText.text hasSuffix:@"/"]) 
{
    appendURl=[NSString stringWithFormat:@"%@%@",self.urlText.text,fvalue];
}
else
{
    appendURl=[NSString stringWithFormat:@"%@/%@",self.urlText.text,fvalue];
}