- (void)viewDidLoad
{
[super viewDidLoad];
dataTable *_mytable = [[dataTable alloc] init];
self.dataTableView = _mytable;
//[_mytable release];
NSMutableArray *_myArray = [[NSMutableArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"杭州市水业集团有限公司南星水厂 ", @"qyName",
@"2011年4月20日",@"time",
nil],
nil];
self.tableDataArray = _myArray;
[_myArray release];
//self.tableDataArray = dataTableView.tableDataArray;
self.myTableViewController = self.dataTableView;
// Do any additional setup after loading the view from its nib.
[self.view addSubview:_mytable.view];
}问题是:
现在[self.view addSubview:_mytable.view];能吧table添加上去,但是self.dataTableView = _mytable;赋值后,换成[self.view addSubview:elf.dataTableView.view];无法现实表格,这个是什么原因?我初学,没搞懂谢谢大家。
{
[super viewDidLoad];
dataTable *_mytable = [[dataTable alloc] init];
self.dataTableView = _mytable;
//[_mytable release];
NSMutableArray *_myArray = [[NSMutableArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"杭州市水业集团有限公司南星水厂 ", @"qyName",
@"2011年4月20日",@"time",
nil],
nil];
self.tableDataArray = _myArray;
[_myArray release];
//self.tableDataArray = dataTableView.tableDataArray;
self.myTableViewController = self.dataTableView;
// Do any additional setup after loading the view from its nib.
[self.view addSubview:_mytable.view];
}问题是:
现在[self.view addSubview:_mytable.view];能吧table添加上去,但是self.dataTableView = _mytable;赋值后,换成[self.view addSubview:elf.dataTableView.view];无法现实表格,这个是什么原因?我初学,没搞懂谢谢大家。
self.dataTableView = _mytable;
---------------------
也不知道你这两行代码的目的是什么,为什么要写在这里,其它控制器类的函数也不知道你怎么写的
{
[super viewDidLoad];
dataTable *_mytable = [[dataTable alloc] init];
NSMutableArray *_myArray = [[NSMutableArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"杭州市水业集团有限公司南星水厂 ", @"qyName",
@"2011年4月20日",@"time",
nil],
nil];
self.tableDataArray = _myArray;
[_myArray release];
_mytable.tableDataArray = self.tableDataArray;
self.myTableViewController = _mytable;
// Do any additional setup after loading the view from its nib.
[self.view addSubview:_mytable.view];
}
改了一下,myTableViewController是一个IB链接,在其他方法里想修改它。