iphone:SDK 公开按钮未响应从第一个 TableView 到第二个详细 TableView 的响应?
如何将第一个表视图行数据传递到
我使用的 第二个详细视图行 [cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
或
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
在每个单元格中显示公开按钮
,我还在
- (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
NSLog(@"disclosure button %@ touched",indexPath.row);
}
中添加了操作但是当我触摸披露按钮 我在控制台中没有显示任何内容
比我在中添加操作
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// carry Alarm Name text into sub-table-view to look for detail time and text info
NSLog(@"Alarm Name = %@", [alarmName objectAtIndex:indexPath.row]);
NSLog(@"Index Path Raw# = %i", indexPath.row);
// Navigation logic may go here. Create and push another view controller.
AlarmDetailTableViewController *detailViewController = [[AlarmDetailTableViewController alloc] initWithNibName:@"AlarmTableViewController" bundle:[NSBundle mainBundle]];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
detailViewController = nil;
}
它可以在控制台模式下通知
但我认为当我触摸第一级 TableView 中的任何行时,它总是显示相同的详细信息视图
如何显示带有数据的新详细信息视图一级?
例如,
要使 tableView1.row0.text=detail view.title
并在标题下显示其他数据,
如果您需要代码,我可以上传它,
我的老板说这里面不是什么大秘密...
非常感谢
How can I pass the first tableview row data to second detail view row
I use[cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
or
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
to show up disclosure button in each cells
it can ,I also add actions in
- (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
NSLog(@"disclosure button %@ touched",indexPath.row);
}
But when I touch the disclosure button I got nothing shows up in console
Than I add actions in
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// carry Alarm Name text into sub-table-view to look for detail time and text info
NSLog(@"Alarm Name = %@", [alarmName objectAtIndex:indexPath.row]);
NSLog(@"Index Path Raw# = %i", indexPath.row);
// Navigation logic may go here. Create and push another view controller.
AlarmDetailTableViewController *detailViewController = [[AlarmDetailTableViewController alloc] initWithNibName:@"AlarmTableViewController" bundle:[NSBundle mainBundle]];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
detailViewController = nil;
}
It can notified on console mode
But I think it always appear the same detail view when I touch any rows in First Level TableView
How to show a new detail view with data from Level one ?
for example
To make the tableView1.row0.text = detail view.title
and show other data under the title
if you need the code I can upload it
my boss said it's not big secret inside...
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许问题出在你的:
应该是:
Perhaps the problem is with your:
which should be reading:
好的,如果您点击附件按钮而不是显示另一个详细视图,
我们需要添加一个详细视图
首先创建一个“
基于新导航的应用程序
”,例如 FirstView右键单击类文件夹并选择“
添加新文件
”选择一个您想要显示的新视图,例如我选择了一个名为“
DetailView
”的新表格视图,然后首先转到DetailView.m,给出一个部分和行号
或声明布局
比返回 FirstView.h
添加
#import DetailView
转到 FirstView.m
找到此方法
- (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
并使用 DetailView 子类创建一个新视图
添加这样的代码
您可以添加您想要显示的任何视图
Ok,if you tapped on accessory button than show another detail view
we need to add a detail view
First create a "
new navigation based application
",ex FirstViewright click on the class folder and choice "
add new File
" choice a new view you wanna displayex I selected a new tableview named "
DetailView
"than first go to the DetailView.m go give a section and row numbers
or declare the layout
than back to FirstView.h
add
#import DetailView
go to FirstView.m
find this method
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
and use DetailView sub class to create a new view
add the codes like this
you can add any view you want to display