-2

Possible Duplicate:
iPhone UITableView Sections

I'm now learning UITableView class on iOS development,How can i implement multiple sections in UITableView for details?Big Thanks!

Community
  • 1
  • 1
Andy_24
  • 1,163
  • 2
  • 11
  • 20
  • -(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{ return 1 or any number of sections you want; } – janusfidel Jun 25 '12 at 11:46
  • 1
    This questions has been asked multiple times. See here: http://stackoverflow.com/questions/6445666/iphone-uitableview-sections – Peter Warbo Jun 25 '12 at 11:47

4 Answers4

0

Return proper value from below delegate method of UITableViewDataSource.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
Apurv
  • 16,846
  • 8
  • 48
  • 66
0

Read this

And yes, read all the other parts as well for a great set of tutorials on UITableView

Bourne
  • 9,700
  • 5
  • 23
  • 51
0

For this you can use the tableview delegate method

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{
    NSInteger iSectionCount = 1;

    return iSectionCount;
}

or simply just

return 1;//For 1 section

inside the delegate method

Melbourne
  • 531
  • 3
  • 24
0

To return a single section do this:

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
        return 1;
    }
Anthon
  • 59,987
  • 25
  • 170
  • 228
self
  • 1,207
  • 1
  • 13
  • 16