title: how to avoid cell selected error in iphone
body: <p>hi friend my application is crash on click cell bec i right this line rowToSelect=indexPath;.but i need this line i have to pass all row for image selected on cellbackground image when i click section1 ==row==0 then i get this error</p>
  
  <blockquote>
    <p>'-[__NSArrayM row]: unrecognized selector sent to instance 0x4c7080'
    <em>*</em> First throw call stack: (0x37e378bf 0x379831e5 0x37e3aacb 0x37e39945 0x37d94680 0x319921e9 0x319921af 0x5b47 0x3193f9cb
    0x3193eaa9 0x3193e233 0x318e2d29 0x37d9622b 0x37430381 0x3742ff99
    0x3743411b 0x37433e57 0x3742bd85 0x37e0bb4b 0x37e09d87 0x37e0a0e1
    0x37d8d4dd 0x37d8d3a5 0x37b64fcd 0x3190d743 0x2927 0x28dc) terminate
    called throwing an exceptionProgram received signal:  “SIGABRT”. Data
    Formatters temporarily unavailable, will re-try after a 'continue'.
    (Can't find dlopen function, so it is not possible to load shared
    libraries.)</p>
  </blockquote>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  
  
      rowToSelect=indexPath;//when i remove this line then my application is not crashing but when i keep
  
       this line the i click section1 and row0 then application is crash why this happen where i am wong please help me
  
  
  
          UIViewController &lt;SubstitutableDetailViewController&gt; *detailViewController = nil;
  
          if ([indexPath row] == 0 &amp;&amp; [indexPath section] == 0) {
              TodoDetailViewController *newDetailViewController = [[TodoDetailViewController alloc] initWithNibName:@"TodoDetailViewController" bundle:nil];
              detailViewController = newDetailViewController;
  
  
          }
  
          if ([indexPath row] == 0 &amp;&amp; [indexPath section] == 1){
              PeopleViewController *newDetailViewController = [[PeopleViewController alloc] initWithNibName:@"PeopleViewController" bundle:nil];
  
              detailViewController = newDetailViewController;
  
          }
  
           if ([indexPath row] == 1 &amp;&amp; [indexPath section] == 1){
              DocumentsViewController *newDetailViewController = [[DocumentsViewController alloc] initWithNibName:@"DocumentsViewController" bundle:nil];
              detailViewController = newDetailViewController;
          }
  
           if ([indexPath row] == 2 &amp;&amp; [indexPath section] == 1){
              PlannerViewController *newDetailViewController = [[PlannerViewController alloc] initWithNibName:@"PlannerViewController" bundle:nil];
              detailViewController = newDetailViewController;
          }
  
  
  
           if ([indexPath row] == 0 &amp;&amp; [indexPath section] == 2){
              ArchivedPeopleViewController *newDetailViewController = [[ArchivedPeopleViewController alloc] initWithNibName:@"ArchivedPeopleViewController" bundle:nil];
              detailViewController = newDetailViewController;
          }
  
  
  
  
          // Update the split view controller's view controllers array.
         NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
          splitViewController.viewControllers = viewControllers;
  
  
          if (popoverController !=nil) 
          {
              [popoverController dismissPopoverAnimated:YES];
          }
         .
          if (rootPopoverButtonItem != nil) {
              [detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
          }
          [detailViewController release];
  
      }
  </code></pre>