title: UITableViewCell Accessory Type Checked on Tap & Set other unchecked
body: <p>I am confused a little bit about settings table view cell accessories.</p>
  
  <p>I have fixed two sections in my table</p>
  
  <ul>
  <li>Home</li>
  <li>Office</li>
  </ul>
  
  <p>What I want is as follow....</p>
  
  <ul>
  <li>When User tap any of the cell</li>
  <li>Cell gets selected &amp; 
  
  <ul>
  <li>I want to set checked (set uitableviewcell accessory type -checked of tapped cell )</li>
  </ul></li>
  <li>And also all other cell's accessory type now should set to 
  
  <ul>
  <li>uitable view cell accessory type none</li>
  </ul></li>
  </ul>
  
  <p>I have tried following code. But I found that indexpath.row &amp; indexpath.section is readonly properties.</p>
  
  <pre><code>// Override to support row selection in the table view.
  -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {    
      [tblProfileView deselectRowAtIndexPath:indexPath animated:YES];
      int i,max;
      UITableViewCell *x; NSIndexPath *tt;
  
      for(i=0;i&lt;[tblProfileView numberOfRowsInSection:0];i++)
      {
          tt.row=i; tt.section=0;
          x=[tblProfileView cellForRowAtIndexPath:];
          [x setAccessoryType:UITableViewCellAccessoryNone];
      }
      for(i=0;i&lt;[tblProfileView numberOfRowsInSection:1];i++)
      {
          tt.row=i; tt.section=1;
          x=[tblProfileView cellForRowAtIndexPath:tt];
          [x setAccessoryType:UITableViewCellAccessoryNone];
      }
  
      x=[tblProfileView cellForRowAtIndexPath:indexPath];
      [x setAccessoryType:UITableViewCellAccessoryCheckmark];
      // Navigation logic may go here -- for example, create and push another view controller.
      // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
      // [self.navigationController pushViewController:anotherViewController animated:YES];
      // [anotherViewController release];
  }
  </code></pre>