Best approach for UITableViewCell with both a left and right label

My app has several settings that multiple choice (e.g. an enum value). I want to replicate iOS' sound settings table view cell, where the name is on the left, the selected value on the right, followed by a disclosure indicator (>).


http://i.stack.imgur.com/1lhHY.png


My approach so far has been to create a custom table view cell (.xib and custom UITableViewCell class), with a value label added to the cell's content view. However, it appears that using textLabel is incompatible with a custom content view (see http://stackoverflow.com/questions/1430295/uitableview-subview-why-this-uilabel-is-not-visible/1430934#1430934). My guess is assigning textLabel?.text causes content view to be overridden or hidden.


What's the best approach for doing this?

Add your own left label to your custom cell. Use that instead of UIKit's textLabel.

The built in UITableViewCellStyleValue1 (aka Right Detail in Interface Builder) will give you that label alignment. Set the accessory view to use a disclosure indicator.

Best approach for UITableViewCell with both a left and right label
 
 
Q