【发布时间】:2012-03-26 10:33:09
【问题描述】:
单击时,我试图从表格行中的对象中获取字符串。我已经看过有关获取字符串并将其传递给合成标签的教程,但是我无法在我的模态视图中将相同的字符串传递给合成字符串。这可能吗?我在父视图中的代码如下。
- (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 发出警报或绘制标签时,我收到 null。非常感谢任何帮助。
【问题讨论】:
标签: iphone ios uitableview didselectrowatindexpath