【问题标题】:Load a DetailViewController in TableViewcontroller在 TableViewcontroller 中加载一个 DetailViewController
【发布时间】:2011-12-31 15:02:45
【问题描述】:

我刚刚学习了这个教程:
Implementing UITableView Sections from an NSArray of NSDictionary Objects

这是一个很好的例子。但我想添加更多功能。我想加载一个detailView。我遵循了 5 个以上的教程来做到这一点,但每次都失败了。 4 小时后,我问你。

如何使用此示例加载detailView

问候,范妮


已经试过了,现在有这个代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSString *selectedRow = nil;
NSDictionary *dictionary = [self.books objectAtIndex:indexPath.row];
    selectedRow = [dictionary objectForKey:@"Title"];

    //Initialize the detail view controller and display it.
    DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
    dvController.selectedRow = selectedRow;
    [self.navigationController pushViewController:dvController animated:YES];

    [dvController release];
    dvController = nil;

但什么都没有发生:/

【问题讨论】:

    标签: iphone objective-c xcode uitableview detailview


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2013-12-07
      • 2014-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-25
      • 2021-02-20
      • 1970-01-01
      相关资源
      最近更新 更多