I have a view similar to the Apple Contacts app, needs to load in "view only" mode with an Edit button that will allow the fields to be edited when pressed. This view is using an SCObjectSection for all the input cells.
When the view loads, the edit button appears properly but all fields are still editable - not locked. Then when I click the Edit button most of the fields get locked (a few do not).
Any ideas on what I might be doing here? Code for edit button is:
self.navigationItem.rightBarButtonItem = [self editButtonItem];
For those fields that do not lock regardless of edit state I am trying to lock them down in the willConfigureCell delegate method:
- (void)willConfigureCell:(SCTableViewCell *)cell
{
if([cell isKindOfClass:[SCDateCell class]])
{
SCDateCell *dateCell = [[SCDateCell alloc] init];
dateCell = (SCDateCell *)cell;
dateCell.allowDetailView = FALSE;
dateCell.datePicker.minuteInterval = 15;
dateCell.label.font = [UIFont fontWithName:@"Helvetica" size:15.0];
dateCell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:15.0];
}
if([cell isKindOfClass:[SCSelectionCell class]])
{
SCSelectionCell *selCell = [[SCSelectionCell alloc] init];
selCell = (SCSelectionCell *)cell;
// *** What do I need here to lock this field down when not in edit mode? ***
[(SCSelectionCell *)cell label].font = [UIFont fontWithName:@"Helvetica" size:15.0];
[(SCSelectionCell *)cell textLabel].font = [UIFont fontWithName:@"Helvetica-Bold" size:15.0];
}
if([cell isKindOfClass:[SCTextViewCell class]])
{
[(SCTextViewCell *)cell textView].font = [UIFont fontWithName:@"Helvetica" size:15.0];
[(SCTextViewCell *)cell textLabel].font = [UIFont fontWithName:@"Helvetica-Bold" size:15.0];
[(SCTextViewCell *)cell textView].editable = FALSE;
}
if([cell isKindOfClass:[SCNumericTextFieldCell class]])
{
SCNumericTextFieldCell *numCell = [[SCNumericTextFieldCell alloc] init];
numCell = (SCNumericTextFieldCell *)cell;
[numCell.textField setEnabled:FALSE];
numCell.textField.font = [UIFont fontWithName:@"Helvetica" size:15.0];
numCell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:15.0];
}
}
Any help you can provide with this is much appreciated!