iphone:SDK 公开按钮未响应从第一个 TableView 到第二个详细 TableView 的响应?

发布于 2024-09-15 12:54:11 字数 1557 浏览 2 评论 0原文

如何将第一个表视图行数据传递到

我使用的 第二个详细视图行 [cell setAccessoryType:UITableViewCellAccessoryDe​​tailDisclosureButton];

cell.accessoryType = UITableViewCellAccessoryDe​​tailDisclosureButton;

在每个单元格中显示公开按钮

,我还在

- (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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡笑忘祈一世凡恋 2024-09-22 12:54:11

也许问题出在你的:

- (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{

应该是:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{

Perhaps the problem is with your:

- (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{

which should be reading:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
浅沫记忆 2024-09-22 12:54:11

好的,如果您点击附件按钮而不是显示另一个详细视图,

我们需要添加一个详细视图

首先创建一个“基于新导航的应用程序”,例如 FirstView

右键单击​​类文件夹并选择“添加新文件”选择一个您想要显示的新视图

,例如我选择了一个名为“DetailView”的新表格视图

,然后首先转到DetailView.m,给出一个部分和行号

或声明布局

比返回 FirstView.h

添加 #import DetailView

转到 FirstView.m

找到此方法 - (void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

并使用 DetailView 子类创建一个新视图

添加这样的代码

DetailView *detailView =[[DetailView alloc]init];
detailView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController pushViewController:detailView animated:YES];

您可以添加您想要显示的任何视图

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 FirstView

right click on the class folder and choice "add new File" choice a new view you wanna display

ex 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

DetailView *detailView =[[DetailView alloc]init];
detailView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController pushViewController:detailView animated:YES];

you can add any view you want to display

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文