UITableView With Multiple Sections

后端 未结 6 1683
名媛妹妹
名媛妹妹 2020-12-04 19:36

I want to make tableView with multiple section but i do not want to use dictionary i have two arrays i want that first array should be loaded in first section and second in

6条回答
  •  星月不相逢
    2020-12-04 20:03

    Change this if (section==0)

    to if (indexPath.section==0)

    You have to implement this function :

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
     {
         if(section == 0)
             return arrSection1.count;
          else
             return arrSection2.count;
     }
    

提交回复
热议问题