I have a simple table model derived as follows:
// Get managedObjectContext from application delegate
NSManagedObjectContext *managedObjectContext = [(LeadershipAppDelegate *)[UIApplication sharedApplication].delegate managedObjectContext];
// Create a class definition for TeamEntity
SCClassDefinition *teamDef =
[SCClassDefinition definitionWithEntityName:@"TeamEntity" withManagedObjectContext:managedObjectContext
withPropertyNames: [NSArray arrayWithObjects:@"teamName", @"teamDescription", nil]];
SCPropertyDefinition *namePropertyDef = [teamDef propertyDefinitionWithName:@"teamName"];
namePropertyDef.attributes = [SCTextFieldAttributes attributesWithPlaceholder:@"enter team name"];
namePropertyDef.type = SCPropertyTypeTextField;
namePropertyDef.title = @"Team Name";
namePropertyDef.required = TRUE;
SCPropertyDefinition *descriptionPropertyDef = [teamDef propertyDefinitionWithName:@"teamDescription"];
descriptionPropertyDef.attributes = [SCTextFieldAttributes attributesWithPlaceholder:@"enter team description"];
descriptionPropertyDef.type = SCPropertyTypeTextField;
descriptionPropertyDef.title = @"Team Description";
descriptionPropertyDef.required = FALSE;
// Instantiate the tabel model
teamTableModel = [SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
// Create and add the objects section
SCArrayOfObjectsSection *objectsSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil
withEntityClassDefinition:teamDef];
objectsSection.addButtonItem = self.navigationItem.rightBarButtonItem;
[teamTableModel addSection:objectsSection];
I would like to have smaller font for detail/add view cell labels. Here is how I did it, but I am asking is there a better way of doing this? For example not to go through all the cells one by one, but to set the font size once for all cells.
- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForSectionAtIndex:(NSUInteger)index withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
SCObjectSection *objectSection = (SCObjectSection *)[detailTableViewModel sectionAtIndex:index];
SCTableViewCell * nameCell = [objectSection cellForPropertyName:@"teamName"];
nameCell.textLabel.font = [UIFont boldSystemFontOfSize:13];
}
I am sorry if this question was covered somewhere else in the forum. Thanks.