首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我正在尝试将数据从UITableViewCell传递到PopUp视图,并使用此代码在弹出视图中传递数据

我正在尝试将数据从UITableViewCell传递到PopUp视图,并使用此代码在弹出视图中传递数据
EN

Stack Overflow用户
提问于 2015-10-20 14:00:09
回答 1查看 115关注 0票数 1
代码语言:javascript
复制
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
     STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SecondViewController"]];

    popupController.cornerRadius = 4;
    [popupController presentInViewController:self];


    [self.navigationController pushViewController:popupController animated:YES];

    popupController.marray1=[NSMutableArray arrayWithObject:[self.first objectAtIndex:indexPath.row]];
    popupController.marray2=[NSMutableArray arrayWithObject:[self.second objectAtIndex:indexPath.row]];
    popupController.marray3=[NSMutableArray arrayWithObject:[self.third objectAtIndex:indexPath.row]];

    NSLog(@"%@",[NSMutableArray arrayWithObject:[self.first objectAtIndex:indexPath.row]]);

}
EN

回答 1

Stack Overflow用户

发布于 2015-10-20 15:22:16

首先设置DataValues,然后按下屏幕。

希望这能解决你的问题。

代码语言:javascript
复制
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
     STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SecondViewController"]];

    popupController.cornerRadius = 4;
 popupController.marray1=[NSMutableArray arrayWithObject:[self.first objectAtIndex:indexPath.row]];
    popupController.marray2=[NSMutableArray arrayWithObject:[self.second objectAtIndex:indexPath.row]];
    popupController.marray3=[NSMutableArray arrayWithObject:[self.third objectAtIndex:indexPath.row]];

    [popupController presentInViewController:self];


    [self.navigationController pushViewController:popupController animated:YES];



    NSLog(@"%@",[NSMutableArray arrayWithObject:[self.first objectAtIndex:indexPath.row]]);

}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33229093

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档