I have a SCTableViewController with a number of date fields on it. I would really like to have them display the dates the same way. To try out my thoughts I came up with this:
- (void)viewDidLoad { [super viewDidLoad]; NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateStyle:NSDateFormatterShortStyle]; SCDataDefinition *taskEntityDef = [self dataDefinitionWithIBName:@"EntityObjectivePeriod"]; taskEntityDef.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) { if([cell isKindOfClass:[SCDateCell class]]) { SCDateCell *dc = (SCDateCell *)cell; dc.dateFormatter = df; } }; }
Is this a reasonable method or is there a more elegant way to set the format of these dates? Over time, I will use a setting to format the dates but short format is fine for now.