I want the last UITableViewCell to have no separator. All other cells should have a separator that spans the entire width of the table. I have been successful with the first requirement, but unfruitful with the second requirement.
The yellow color is for debugging purposes. It allows you to see the width of the cell, which is the same as the width of the table. As you can see, the separator should not be narrower than cell, because I set the separator insets to zeros.
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// <typical boilerplate code here>
cell.backgroundColor = [UIColor yellowColor];
if ((NSUInteger)(indexPath.row) == self.options.count - 1) {
cell.separatorInset = UIEdgeInsetsMake(0.0, tableView.width, 0.0, 0.0);
} else {
cell.separatorInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0);
}
}