Note that there are some explanatory texts on larger screens.

plurals
  1. POUILabel on UITableViewCell does not appear correctly
    primarykey
    data
    text
    <p>I have an interface configured using constraints in interface builder. It is set up as shown: <a href="http://imgur.com/a/xqa7D" rel="nofollow">http://imgur.com/a/xqa7D</a>.</p> <p>When the cell is rendered, the right hand label does not appear (but a space for it remains): <a href="http://imgur.com/xwBSSMD" rel="nofollow">http://imgur.com/xwBSSMD</a>.</p> <p>The cell in question is a custom UITableViewCell subclass:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface ProgressCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *textLabel; @property (weak, nonatomic) IBOutlet UIProgressView *progressView; @property (weak, nonatomic) IBOutlet UILabel *detailTextLabel; @end </code></pre> <p>There is no further logic on the class.</p> <p>The table view cell is instantiated from the identifier that I have set on the storyboard:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ProgressCell"; ProgressCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; Object *room = [self.rooms objectAtIndex:indexPath.row]; cell.textLabel.text = room.name; cell.progressView.progress = 1.0f - ((float)room.avail)/room.total; cell.detailTextLabel.text = [NSString stringWithFormat:@"%d/%d", room.avail, room.total]; return cell; } </code></pre> <p>If I set a breakpoint at the end of the function and do <code>po [[cell detailTextLabel] text]</code>, the text is set correctly. The label is not hidden.</p> <p>I am completely at a loss as to the possible cause. What could be triggering this behaviour?</p> <p>Other things I've tried:</p> <ul> <li>renaming the property to something other than detailTextLabel (in case of a possible clash) does not work</li> <li>if I add a third label, with default text, that shows correctly</li> <li>if I add a third label and connect that outlet in IB to the one that does not appear, then the default text for the problem label appears, but the third label is hidden</li> </ul> <p>EDIT:</p> <p>If I log the ultimate position of the frame in question, it sits at <code>{{0, 44}, {0, 0}}</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload