現在画像とテキストを表示しているが詳細テキストは表示していないカスタムセルを作成しました。
「cell.detailTextLabel.text」を使用しても、表示されません。誰かが何が悪いのか考えているだろうか?
UITableViewCellStyleSubtitleをUITableViewCellStyleDefaultなどに変更してみました。
私はこのサイトとグーグルをここ数時間検索して修正を試みましたが、どれもうまくいきませんでした。
どんな助けでもいただければ幸いです。
-(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"]]
}
セルのスクリーンショットへのリンクは次のとおりです(10の担当者なしで画像を添付することは許可されていません):