У меня есть свойство DotImageView в моем подклассе UITableViewCell.Отображение UIImageView в подклассе UITableViewCell в cellForRowAtIndexPath
@property (nonatomic, retain) IBOutlet UIImageView *DotImageView;
Я стараюсь, чтобы отобразить его, как это в методе cellForRowAtIndexPath:
static NSString *TargetCellIdentifier = @"TargetDetailTableViewCellIdentifier";
TargetDetailTableViewCell *cell = (TargetDetailTableViewCell *)[tableView dequeueReusableCellWithIdentifier:TargetCellIdentifier];
if (cell == nil) {
UINib *nib = [UINib nibWithNibName:@"TargetDetailTableViewCell" bundle:nil];
[nib instantiateWithOwner:self options:nil];
cell = self.TargetCell;
self.TargetCell = nil;
}
NSUInteger row = [indexPath row];
NSInteger section = [indexPath section];
Target *aTarget = [targetDictionary objectForKey:[NSNumber numberWithInteger:section]];
if (row == 0) {
UIImage *dot;
if (aTarget.importance == high) {
dot = [UIImage imageNamed:@"dot_red.png"];
}
else {
dot = [UIImage imageNamed:@"dot_gray.png"];
}
UIImageView *variantImageView = [[UIImageView alloc] initWithImage:dot];
cell.DotImageView = variantImageView;
[variantImageView release];
return cell;
Я не вижу изображение в моей камере. Остальные ярлыки моего подкласса UITableViewCell действительно отображаются. Я что-то упустил с помощью UIImageView? Я не очень хорошо знаком с этим. Благодарю.
cell.DotImageView его созданный? возможно, вы забыли связать его в xib – Edig
, когда вы скажете: «У меня есть свойство DotImageView в моем UITableViewSubclass», это UITableViewCell? Я думаю, нам нужно увидеть ваше объявление UITableViewCell в методе cellForRowAtIndexPath. – TheRonin
@Ernesto Я проверил наконечник, и он выглядит связанным – Crystal