Welcome, Guest
Username Password: Remember me

SCImagePickerCell displayImageNameAsCellText property
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: SCImagePickerCell displayImageNameAsCellText property

SCImagePickerCell displayImageNameAsCellText property 1 year, 6 months ago #1

In my core data bound SCArrayOfObjectsModel, I am trying to set the displayImageNameAsCellText property of my SCImagePickerCell so it will not show the image name in the cell. I'm not sure if I'm just setting it in the wrong place or what, but it doesn't appear to be working like I expect. The cell's textLabel still shows the image filename.



- (void)tableViewModel:(SCTableViewModel *) tableViewModel willDisplayCell:(SCTableViewCell *) cell forRowAtIndexPath:(NSIndexPath *) indexPath
{
cell.selectionStyle = UITableViewCellSelectionStyleGray;
 
// Detail view
if (tableViewModel.tag == 1)
{
// Don't want text on imagepicker cell
if ([cell isKindOfClass:[SCImagePickerCell class]])
{
SCImagePickerCell *tmpCell = (SCImagePickerCell *) cell;
tmpCell.displayImageNameAsCellText = NO;
//cell.textLabel.text = @"";
return;
}
else if ([cell isKindOfClass:[SCDateCell class]])
{
SCDateCell *tmpCell = (SCDateCell *) cell;
tmpCell.datePicker.datePickerMode = UIDatePickerModeDate;
}
}
}
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5

Re: SCImagePickerCell displayImageNameAsCellText property 1 year, 6 months ago #2

Hi Tommy,

This should be done in the tableViewModel:willConfigureCell:forRowAtIndexPath delegate method. willDisplayCell gets called right before the cell is displayed, and thus all the cell's properties have been already configured, and it's too late to set any configuration properties such as displayImageNameAsCellText. You can however set cell.textLabel.text in willDisplayCell to override whatever value it has at display time.

Please tell me if this works well for you.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCImagePickerCell displayImageNameAsCellText property 1 year, 6 months ago #3

In willConfigureCell, do I just use the indexPath to make sure I'm using the correct cell and then cast "cell" as an SCImagePickerCell?

Thanks for your help on this.
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5

Re: SCImagePickerCell displayImageNameAsCellText property 1 year, 6 months ago #4

Yes Tommy, and you can also use exactly the same code you used in willDisplayCell. Please tell me if you need any more help.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCImagePickerCell displayImageNameAsCellText property 1 year, 6 months ago #5

got it, thanks!
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5
  • Page:
  • 1
Time to create page: 0.89 seconds