【发布时间】: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