UITableView With Multiple Sections

后端 未结 6 1685
名媛妹妹
名媛妹妹 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:18

    Your numberOfRowsInSection should be something like this:

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

提交回复
热议问题