【发布时间】:2011-03-21 09:15:15
【问题描述】:
我正在制作一个基于导航的应用程序,但我注意到我的应用程序存在缺陷。即使我有多个按钮,每个按钮都有自己的标题,无论我按什么按钮,按钮都会引导您进入同一个屏幕。有没有办法确保每个按钮都指向特定于按下按钮的页面。例如单击选项,它会将您带到选项菜单,而不是单击图像,它会将您带到选项菜单。任何帮助将不胜感激谢谢。 这是我的堆栈弹出方法:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Anotherviewcontroller *detailViewController = [[Anotherviewcontroller alloc] initWithNibName:@"Anotherviewcontroller" bundle:nil];
detailViewController.currentItem = @"Years";
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
【问题讨论】:
-
请发布 ViewController 代码的“- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {”部分中的代码。
标签: iphone cocoa-touch navigation