Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView detailTextLabel not working with custom cell
    primarykey
    data
    text
    <p>I've created a custom cell which currently is showing an image and text, but not the detail text. </p> <p>Even with "cell.detailTextLabel.text", it still won't show. Would anybody have an idea what's wrong? </p> <p>I've tried changing UITableViewCellStyleSubtitle to UITableViewCellStyleDefault and others. </p> <p>I've searched this site and google for the last couple of hours trying fixes, none of them worked. </p> <p>Any help would be appreciated. </p> <pre><code>-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"myCell"; UITableViewCell *cell = (UITableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; } NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; NSArray *sortedCategories = [self.tweetSongs.allKeys sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; NSString *categoryName = [sortedCategories objectAtIndex:indexPath.section]; NSArray *currentCategory = [self.tweetSongs objectForKey:categoryName]; NSDictionary *currentArtist = [currentCategory objectAtIndex:indexPath.row]; NSDictionary *currentSong = [currentCategory objectAtIndex:indexPath.row]; cell.textLabel.text = [currentSong objectForKey:@"Song"]; cell.detailTextLabel.text = [currentArtist objectForKey:@"Artist"]; cell.textLabel.textColor = [UIColor whiteColor]; cell.imageView.image = [UIImage imageNamed:[currentArtist objectForKey:@"Artwork"]] } </code></pre> <p>Here's a link to the screenshot of the cells (i'm not allowed to attach an image without a rep of 10):</p> <p><img src="https://i.stack.imgur.com/dKEtU.png" alt="enter image description here"></p>
    singulars
    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.
    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