UITableView With Multiple Sections

后端 未结 6 1676
名媛妹妹
名媛妹妹 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条回答
  •  Happy的楠姐
    2020-12-04 20:07

    TableView Delegate Method already give the section as :(NSInteger)section.. so we can also use switchCase

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
        {
            switch (section)
            {
                case 0:
                    return self.arrMedia.count;
                    break;
                case 1:
                    return 1;
                    break;
            }
            return 0;
        }
    

提交回复
热议问题