views:

36

answers:

1

Hello all,

I am developing an iphone app in which i have a segmented control that has details related to something like a book .

I want to show books menu tapping on books segment with uitableviewplain style .

but now I want another segment which should show the book vendor details with uitableviewgrouped .

how can i manage both these views with the segmented controller and mange the data source and delegate methods.

+1  A: 

It seems that the simplest way to do that is to create two UITableViews for each purpose and show/hide them according to segmented control value. In delegate and data source methods just check what tableview are you using, like:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (tableView == plainView){

   }
    if (tableView == groupView){
   }
 }
Vladimir
but for plain view how to disable the - (NSString *)tableView:(UITableView *)tblView titleForHeaderInSection:(NSInteger)section method
hib
Doesn't if (tableView == plainView) return nil;do the trick? Spec says: "...A string to use as the title of the section header. If you return nil , the section will have no title"
Vladimir
thanksman its done
hib