【发布时间】:2013-03-14 17:43:22
【问题描述】:
我需要创建一个NSString 来浏览 FTP 共享中的文件夹。我在 TableView 上显示目录,用户可以通过选择行来浏览
我将选定行的字符串写入可变数组,然后我需要将可变数组中的所有字符串组成一个字符串。表示选择行时将最后一个字符串添加到上一个字符串
例如数组中的第一个字符串是“Downloads”第二个“Movies”第三个“HD-Movies”......等等 为此,我需要第一次选择行“/Downloads/”上的字符串 第二次“/Downloads/Movies/”,第三次“/Downloads/Movies/HD-Movies”
我确定我需要NSMutableString,但不知道如何添加字符串...
这是我的代码的一部分:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSMutableArray *filePathArray = [[NSMutableArray alloc]init];
[filePathArray addObject:@"/Downloads/"];
[filePathArray addObject:[fileNameArray objectAtIndex:indexPath.row]];
}
【问题讨论】:
标签: iphone xcode nsstring nsmutablearray nsmutablestring