gpt4 book ai didi

ios - didSelectRowAt 索引不起作用

转载 作者:行者123 更新时间:2023-11-29 03:15:07 24 4
gpt4 key购买 nike

我正在尝试将 url 字符串推送到我的 Main,当我按下单元格时它会显示我的主视图 Controller 。

这是我的代码。

 #pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"Index Selected,%d",indexPath.row);

MainViewController *View = [self.storyboard instantiateViewControllerWithIdentifier:@"main"];

[self.navigationController modalTransitionStyle];
NSString *urltoPass = [NSString stringWithString:[[tableData objectAtIndex:indexPath.row]objectForKey:@"cellSubtitle"]];

View.urlString = [[NSString alloc] initWithFormat:@"http://%@",urltoPass];
View.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[myTableView deselectRowAtIndexPath:indexPath animated:YES];

}

最佳答案

您需要调用

– presentViewController:animated:completion:

在您的 View Controller 上呈现它。

关于ios - didSelectRowAt 索引不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21777329/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com