objective c - How to search in UITableview which have multi section in iOS -


my uitableview have 2 section "local currency" , "all currencies".

no problem when search , both section return results. when search , return results within section 2 no cell in section "all currencies" displayed. 's display header of "local currency" 0 cell.

i want when search if section no have in result header of session hidden , secion have result display header , content.

this code , searchresultslocal,searchresultspopular 2 results nsarray when search:

-(nsinteger)numberofsectionsintableview:(uitableview *)tableview {     //if (searchresultslocal.count > 0 && searchresultspopular.count > 0) {     //    return 2;     //}     return 2; }  -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     if (section==0) {         return [searchresultslocal count];     }     return searchresultspopular.count; } 

ay appreciable. in advance.

tks u much.i have figure out solution :

- (cgfloat)tableview:(uitableview *)tableview heightforheaderinsection:(nsinteger)section {     if ([tableview.datasource tableview:tableview numberofrowsinsection:section] == 0) {         return 0;     }      return 20; } 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -