在 TableViewcontroller 中加载 DetailViewController
我刚刚遵循了本教程:
实现 UITableView 部分NSDictionary 对象的 NSArray
这是一个很好的例子。但我想添加更多功能。我想加载一个 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;
但什么也没有发生:/
I just followed this tutorial:
Implementing UITableView Sections from an NSArray of NSDictionary Objects
This is a good example. But I want to add more fonctions. I want to load a detailView
. I followed more than 5 tutorials to do it, but I fail every time. After 4 hours, i'm asking you.
How can I load a detailView
with this sample?
Regards, Fanny
Already tried, nowi have this code:
- (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;
But nothing appen :/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
希望本教程对您有所帮助。
http://www.xcode -tutorials.com/uitableview-%E2%80%93-2-loading-a-detail-view/
Hope this tutorial help you.
http://www.xcode-tutorials.com/uitableview-%E2%80%93-2-loading-a-detail-view/