文章目录
  1. 1. iOS View中不能直接代码add tableView

iOS View中不能直接代码add tableView

\

self.searchTableView
=
[[
UITableView
alloc]
initWithFrame:CGRectMake(0,
0,
320,
<span

style=”font: 14.0px Menlo; font-variant-ligatures: no-common-ligatures; color: #8b84cf”>350)];
       
self.searchTableView.hidden=YES;
       
UINib
*cellNib=[UINib
nibWithNibName: “SearchPoiCell”
bundle:nil];
        [
self.searchTableView
registerNib:cellNib
forCellReuseIdentifier: “SearchPoiCell”];
       
self.searchTableView.delegate
=
self;
       
self.searchTableView.dataSource
=
self;
       
self.listData
=
[[
NSMutableArray
alloc]
init];
       
UIView
*view
= [[
UIView
alloc]
initWithFrame:CGRectMake(0,
74,
320,
350)];
        view.
backgroundColor
=
[
UIColor
redColor];
        [view
addSubview:self.searchTableView];

        [viewController.view
addSubview:view];

文章目录
  1. 1. iOS View中不能直接代码add tableView