【发布时间】:2013-05-11 01:21:57
【问题描述】:
我很确定这真的很简单。但我无法完成这项工作。我有一个 UITableView,我在其中动态显示 facebook 朋友的列表,这要归功于他们的 FBID。基本上,我想在一个用逗号分隔的字符串中返回我选择的朋友的 FBID。如果可能,在 IBAction 中,我可以将它们传递给 php.ini 的参数。 例如,假设我有 4 个朋友 A B C D 的列表,他们的 id 是 1,2,3,4。 如果我选择 A 和 C,我想要一个字符串,上面写着 1,3。
我所做的只是显示我选择的朋友的 ID,一次一个。 这是我的代码:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
rowcount = [[tableView indexPathsForSelectedRows] count];
indexer = [idFriends objectAtIndex:indexPath.row];
aapell = [NSString stringWithFormat:@"%@", indexer];
NSMutableString * arrayIds = [[NSMutableString alloc] init];
[arrayIds appendString:aapell];
NSLog(@"ids: %@", arrayIds);
}
提前谢谢你,我相信这并不复杂。
【问题讨论】:
标签: ios objective-c uitableview nsstring didselectrowatindexpath