1
我试图从单击表格行中的对象时单击该字符串。我看过有关获取字符串并将其传递给合成标签的教程,但是我无法将相同的字符串传递到我的模态视图中的合成字符串。这可能吗?我在父视图中的代码如下。将字符串传递到模态视图
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Modules *selectedModule;
selectedModule = [fixedArray objectAtIndex:indexPath.row];
NSString *moduleComponent = [selectedModule valueForKey:@"name"];
DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"Detail"];
[self.navigationController pushViewController:detail animated: YES];
detail.number.text = moduleComponent;
detail.moduleLabel.text = moduleComponent;
detail.module = moduleComponent;
}
的detail.moduleLabel.text正确显示然而,当我试图提醒或使用我收到空的detail.module绘制一个标签。任何帮助是极大的赞赏。
你是因为我在pushViewController消息后分配了值。我错误地认为设置标签直接以这种方式工作,所以传递字符串也是如此。谢谢。 – dmeads89 2012-03-26 14:26:42