iPhone UITableView Sections

前端 未结 2 1687
一个人的身影
一个人的身影 2020-12-06 02:34

I have been programming a UITableView and each cells pushes a new view, All I Want to do is add two new sections one male and one female, first and second voice need to be i

2条回答
  •  离开以前
    2020-12-06 03:37

    Hows this?

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        // Return the number of sections.
        return 2;
    }
    
    
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        // Return the number of rows in the section.
        switch (section) {
            case 0:
                return # of rows in section;
                break;
            case 1:
                return # of rows in section;
    break;
        }
        return 0;
    }
    

提交回复
热议问题