ios - 导航 Controller 不将数据从 tableview 传递到 viewcontroller

标签 ios uitableview ios5 ios6 uinavigationcontroller

表格 View 的代码:

-(void)tableView:(UITableView *)tableView didselectRowAtIndexPath:(NSIndexPath *)indexPath{

    ViewControllerDisplayMsg *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController3"];


    cellvalue=[array objectAtIndex:indexPath.row];
    detail.DisplayMsgString = cellvalue;
    [self.navigationController pushViewController:detail animated:YES];

    }

viewController3 中的代码:

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.DisplayMsgLabel.text= self.DisplayMsgString;

}

打开 viewcontroller3 时,上面的代码没有将数据传递给空白。为什么数据没有传递。缺少什么代码?

请帮助我。非常感谢您的帮助。

提前致谢。

最佳答案

你用过

   -(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{

       }

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

       }

我希望你打错了,如果不是这个,请分享你的结果

关于ios - 导航 Controller 不将数据从 tableview 传递到 viewcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15541895/

相关文章:

iOS:如何在sqlite中插入特殊字符如 "or '

ios - Skobbler iOS SDK 对当前位置使用什么位置设置?

ios - UIProgressView 无法按预期与 NSTimer 一起工作 - Swift

json - 为什么我的 json 不会将列表中的所有对象解析为带有标题的不同行?

ios - 在应用捏手势时更改UILabel的字体大小

iphone - 我们可以将Core Data类添加到iOS中的框架吗?

ios - pod 安装失败, react native 0.44

ios - UITableView push segue 触发多次

iphone - UITableView - 延迟加载联系人图像

ipad - iPad 上的 iOS 5 UISplitViewController 不在纵向上显示 MasterView(但仅在最初)