title: UITableViewCell configuration
body: <p>I have a UITableView in my app, which stores a list of URLs. Above table there are UITextField and UIButton.
  When user types some URL on textField and then presses the button I add those URL like the top element in the tableView.
  Next, when user selects any of URLs, I want to create a button within selected UITableViewCell  to let user to follow that URL (actually, it's not important). Here's <code>didSelectRowAtIndexPath</code> method definition:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [self.recentUrlsTableView cellForRowAtIndexPath:indexPath];
  
      UIButton *button = [UIButton new];
      button.frame = CGRectMake(cell.frame.size.width - 34, cell.frame.origin.y + 10, 24, 24);
      button.backgroundColor = [UIColor lightGrayColor];
      [button setTitle:@"&gt;" forState:UIControlStateNormal];
      [cell.contentView addSubview:button];
      [button release];
  }
  </code></pre>
  
  <p>But I want those button to disappear when I deselect cell. So, I tried this thing (I kow it looks stupid, but unfortunately I didn't know better way to find my button in there):</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [self.recentUrlsTableView cellForRowAtIndexPath:indexPath];
      for (UIView *subview in cell.subviews)
      {
          if ([subview isKindOfClass:[UIButton class]])
              if ([[(UIButton*)subview titleLabel].text isEqualToString:@"&gt;"])
              {
                  [subview removeFromSuperview];
                  [subview release];
              }
      }
  }
  </code></pre>
  
  <p>But this stuff seemed to work incorrectly - instead of releasing and disappearing at all, button started to in another rows - even those, which were empty.</p>
  
  <p>After that I tried to do same actions for every row in <code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath</code> method. But it also didn't help.</p>
  
  <p>I guess, that there are some trivial issue, but I can't find it. So, I will highly appreciate any of your help!</p>