hungbm06
hungbm06

Reputation: 1549

How many UITableView can place in a View?

I'm beginner in Iphone!
Can I place many UITableView (greater 1) in a View? And how to control them?

Upvotes: 2

Views: 141

Answers (2)

Madhup Singh Yadav
Madhup Singh Yadav

Reputation: 8114

Well its not a good idea to have multiple tableviews in a view but if you want it you can have them and control the by there names like

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if(tableView == declaredTableView1){
return 10;
}
else if(tableView == declaredTableView2){
return 11;
}
else {
return 12;
}   
}

Hope this helps.

Upvotes: 0

Ben Gottlieb
Ben Gottlieb

Reputation: 85522

You can place as many UITableViews into a parent view, but it's probably not a good idea. Each delegate and datasource method for a tableView takes that tableView as its first argument, so it's easy to tell them apart.

Upvotes: 1

Related Questions