【发布时间】:2013-03-21 07:39:57
【问题描述】:
Tableview 的代码:
-(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打开时没有传递数据,它是空白的。为什么数据没有传递。缺少什么代码?
请帮帮我。非常感谢您的帮助。
提前致谢。
【问题讨论】:
-
你在ViewControllerDisplayMsg中创建了DisplayMsgString的属性并正确合成了吗?
-
您好,先生。 @property (strong, nonatomic) IBOutlet UILabel *DisplayMsg; @property(strong,nonatomic)NSString *DisplayMsgString; 这是它在 .h 中的样子,我还没有合成为它在 ios6.1 xcode 4.6 中自动合成正确?
-
不,没关系,您不必在 ios 6.1 中进行合成
-
检查 IB 中的 UILabel 连接;代码对我来说看起来不错。
-
你好,马特,我这样做了两次。
标签: ios uitableview ios5 ios6 uinavigationcontroller