-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,353
  • 2
  • 12
  • 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
  • 17,116
  • 8
  • 51
  • 67
0

Read this

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

Bourne
  • 10,094
  • 5
  • 24
  • 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
  • 69,918
  • 32
  • 186
  • 246
self
  • 1,205
  • 1
  • 14
  • 17