如何使用弹出窗口更新detailView

问题描述

| 我有一个“ 0”,它由一个弹出框表示,通过选择工具栏上的一个栏按钮项可以显示该弹出框。我遇到了一个问题,但是当我从弹出窗口的表格中选择一个项目时,它不会更新视图(
affirmaPDFViewController
) 这是我的
PDFTableController
(弹出框)的
DidSelectRowAtIndex
方法
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

affirmaPDFViewController.detailItem = [Nsstring stringWithFormat:@\"%@\",[listofPDF objectAtIndex:indexPath.row]];
affirmaPDFViewController.i = indexPath.row;
NSLog(@\"%d\",indexPath.row);
NSLog(@\"%@\",[listofPDF objectAtIndex:indexPath.row]);
NSLog(@\"%d\",affirmaPDFViewController.i);
NSLog(@\"%@\",affirmaPDFViewController.detailItem);
}
在这里,indexPath.row和objectAtIndex:indexPath.row都返回正确的值。但是,当我将变量“ 1”分配给这些值时,它们仅返回0和null。 有人告诉我这是因为我还没有创建
affirmaPDFViewController
的实例。但是,我不确定如何创建这样的实例。我将在此方法中放入什么代码才能使其正常工作? 提前致谢!     

解决方法

-(void)viewDidLoad {     [super viewDidLoad];     affirmaPDFViewController = [[[NameOfClassGoesHere alloc] initWithNibName:@ \“ NibNameGoesHere \” bundle:nil]; }     

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...