title: How can i start my UITableView section with number 0 when i have multiple sections?
body: <p>=> <strong>I know , this is silly question , but this is more important for new iPhone developer as I.</strong></p>
  
  <p>here i have question related to <strong>UITableView section</strong> :</p>
  
  <p><strong>First Problem :</strong> i have question that how can i start my UITableView section with number 0 from multiple section ? </p>
  
  <p><strong>For Example :</strong></p>
  
  <p>I have 11 number of section in <code>UITableView</code> and in <code>numberOfSectionsInTableView</code> delegate method, my section is first start with 11th number of section then 0,1,2,3,4,5,6,7,8,9 and 10.
  so how can i start my section number with 0 number and then as it is .</p>
  
  <p><strong>second problem :</strong> in <code>titleForHeaderInSection</code> delegate method my all sections of tableView is repeat 3 times. and at current ViewController  i scrolling UITableView up or down then section display as normal (0 to 11 ) this normal section of UITableView display after repetition of section 3 times. </p>
  
  <p><strong>For Example :</strong></p>
  
  <p>I use <code>NSLog (@" %d ", section );</code> in  <code>titleForHeaderInSection</code> delegate method then display out put in console as as below</p>
  
  <p><strong>Console out put :</strong></p>
  
  <pre><code>2012-09-17 12:27:47.424 Quotes2You[1623:f803]  11 
  2012-09-17 12:27:47.426 Quotes2You[1623:f803]  11 
  2012-09-17 12:27:47.427 Quotes2You[1623:f803] 11
  2012-09-17 12:27:47.428 Quotes2You[1623:f803]  0 
  2012-09-17 12:27:47.429 Quotes2You[1623:f803]  0 
  2012-09-17 12:27:47.429 Quotes2You[1623:f803] 0
  2012-09-17 12:27:47.430 Quotes2You[1623:f803]  1 
  2012-09-17 12:27:47.431 Quotes2You[1623:f803]  1 
  2012-09-17 12:27:47.431 Quotes2You[1623:f803] 1
  2012-09-17 12:27:47.432 Quotes2You[1623:f803]  2 
  2012-09-17 12:27:47.433 Quotes2You[1623:f803]  2 
  2012-09-17 12:27:47.433 Quotes2You[1623:f803] 2
  2012-09-17 12:27:47.434 Quotes2You[1623:f803]  3 
  2012-09-17 12:27:47.435 Quotes2You[1623:f803]  3 
  2012-09-17 12:27:47.436 Quotes2You[1623:f803] 3
  2012-09-17 12:27:47.436 Quotes2You[1623:f803]  4 
  2012-09-17 12:27:47.437 Quotes2You[1623:f803]  4 
  2012-09-17 12:27:47.438 Quotes2You[1623:f803] 4
  2012-09-17 12:27:47.438 Quotes2You[1623:f803]  5 
  2012-09-17 12:27:47.439 Quotes2You[1623:f803]  5 
  2012-09-17 12:27:47.439 Quotes2You[1623:f803] 5
  2012-09-17 12:27:47.440 Quotes2You[1623:f803]  6 
  2012-09-17 12:27:47.441 Quotes2You[1623:f803]  6 
  2012-09-17 12:27:47.462 Quotes2You[1623:f803] 6
  2012-09-17 12:27:47.463 Quotes2You[1623:f803]  7 
  2012-09-17 12:27:47.464 Quotes2You[1623:f803]  7 
  2012-09-17 12:27:47.465 Quotes2You[1623:f803] 7
  2012-09-17 12:27:47.466 Quotes2You[1623:f803]  8 
  2012-09-17 12:27:47.466 Quotes2You[1623:f803]  8 
  2012-09-17 12:27:47.467 Quotes2You[1623:f803] 8
  2012-09-17 12:27:47.472 Quotes2You[1623:f803]  9 
  2012-09-17 12:27:47.476 Quotes2You[1623:f803]  9 
  2012-09-17 12:27:47.478 Quotes2You[1623:f803] 9
  2012-09-17 12:27:47.480 Quotes2You[1623:f803]  10 
  2012-09-17 12:27:47.481 Quotes2You[1623:f803]  10 
  2012-09-17 12:27:47.481 Quotes2You[1623:f803] 10
  2012-09-17 12:27:47.487 Quotes2You[1623:f803]  0 
  2012-09-17 12:27:47.487 Quotes2You[1623:f803]  1 
  2012-09-17 12:27:47.489 Quotes2You[1623:f803]  2 
  </code></pre>
  
  <p><strong>first this repeat all section 3 times and after when i scroll UITableView then section start with 0 (as normal)</strong></p>
  
  <p><strong>My code is here :</strong></p>
  
  <p><strong>ThirdViewController.h</strong> </p>
  
  <pre><code>@interface ThirdViewController : UIViewController&lt;UITableViewDataSource, UITableViewDelegate&gt;
  {
         UITableView *tblCustomer;
          NSArray *listOfsection;
  }
  @property (nonatomic,retain) UITableView *tblCustomer;
  @property (nonatomic,retain) NSArray *listOfsection;
  
  @end
  </code></pre>
  
  <p><strong>ThirdViewController.m</strong></p>
  
  <pre><code>@synthesize tblCustomer , listOfsection;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
       self.tblCustomer = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,417) style:UITableViewStyleGrouped];
      self.tblCustomer.delegate = self;
      self.tblCustomer.dataSource = self;
      [self.view addSubview:self.tblCustomer];
  
      self.listOfsection = [[NSArray alloc]  initWithObjects:@"Name", @"Company", @"Address", @"Email", @"Mobile", @"Phone", @"Potential", @"Sales Status", @"Genre", @"Distributor", @"Dist Rep", @"Internal Notes", nil];
  
  }
  
  #pragma mark - UITableView Datasource Methods
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
      return [self.listOfsection count];
  }
  
  - (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section
  {
      int numSection=0;
  
        if (section == 2)
          numSection = 5;
      else
          numSection = 1;
  
      return numSection;
  }
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
          // here is my code cellForRowAtIndexPath as section wise 
  }
  
  - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
  {
      NSLog(@" %d ", section);
       NSString *sectionHeader = nil;
  
      sectionHeader = [self.listOfsection objectAtIndex:section];
  
      // here is section overwrite //
  
        return sectionHeader;
  }
  
  #pragma mark - Memory Management
  
  -(void)dealloc
  {
      [super dealloc];
  
      [self.listOfsection release];
      [self.tblCustomer release];
  }
  </code></pre>
  
  <p>Thanks in advance</p>