title: Wrong contentView width in custom UITableViewCell?
body: <p>In a UITableViewCell subclass I override <code>layoutSubviews</code> because I need to calculate the frames of a couple of subviews. The base for all of my calculations is the width of the content view. This is how the beginning of my implementation of <code>layoutSubviews</code> looks like:</p>
  
  <pre><code>- (void) layoutSubviews
  {
    [super layoutSubviews];  // invoke this to set up the content view's bounds
  
    CGFloat contentViewWidth = self.contentView.bounds.size.width;
  
    [...]  // calculate and assign frames to subviews
  }
  </code></pre>
  
  <p>I have started testing this in a grouped table view in the iPhone simulator. The cell is supposed to consist of only what's inside the content view, i.e. I have turned off all the surrounding fancy stuff. Specifically, I have disabled the accessory view by setting the accessory type to <code>UITableViewCellAccessoryNone</code>. Due to this, the accessory view is hidden, although its bounds/frame properties still report a size of 20/20.</p>
  
  <p>Based on all this, and the following simple illustration, I would expect the content view width in the above code snippet to be reported as 300.</p>
  
  <pre><code>&lt;----------- screen width = 320 -----------&gt;
  +------------------------------------------+
  |                                          |
  |    &lt;--- content view width = 300 ---&gt;    |
  |    +--------------------------------+    |
  |&lt;--&gt;|         table view cell        |&lt;--&gt;|
  | 10 +--------------------------------+ 10 |
  |                                          |
  |                  [...]                   |
  </code></pre>
  
  <p>But it's not, the content view width that is actually reported is 270!</p>
  
  <p>A bit of research shows that the 30 missing points are comprised of a) 20 width of the accessory view, and b) 10 spacing between content view and accessory view. I tried setting the accessory view size to 0/0, the effect was that the content view width is now reported as 290. Slightly better, but still 10 points off. I also tried setting the <code>accessoryView</code> property to <code>nil</code>, but the view is simply re-created by <code>[super layoutSubviews]</code>.</p>
  
  <p>Finally, the question: Is there a way to <strong>really</strong> disable the accessory view so that it is not included in the calculation of the content view width? Alternatively, would it be safe to skip invoking <code>[super layoutSubviews]</code> and simply calculate the width myself?</p>