Welcome, Guest
Username Password: Remember me

keyboard question
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: keyboard question

keyboard question 1 year, 4 months ago #1

Is there a way to request the keyboard opens without having a capital letter enabled?

Thanks...

Re: keyboard question 1 year, 4 months ago #2

Hi David,

Assuming this is for an auto generated SCTextFieldCell, all you need to do is this:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel
willConfigureCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if([cell isKindOfClass:[SCTextFieldCell class]])
{
SCTextFieldCell *textFieldCell = (SCTextFieldCell *)cell;
textFieldCell.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
}
}
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: keyboard question 1 year, 3 months ago #3

Hi, I'm trying to do the same thing but that method gets no called at all. I'm using the beta version. Has anything changed at all? Can anyone confirm that the example above works?

Re: keyboard question 1 year, 3 months ago #4

Hi Oscar,

Are you sure you're conforming to the SCTableViewModelDelegate protocol in your view controller's header file? Would you please post more code? Thanks!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: keyboard question 1 year, 3 months ago #5

Sure, here's my header file:

@interface ExpensesListViewController : UITableViewController <SCTableViewModelDataSource, SCTableViewModelDelegate> {
SCTableViewModel *tableModel;
}


And this is my implementation

- (void)viewDidLoad {
[super viewDidLoad];
 
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
 
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
self.navigationItem.rightBarButtonItem = addButton;
[addButton release];
 
NSManagedObjectContext *managedObjectContext = [(SimpleExpensesAppDelegate *)[UIApplication sharedApplication].delegate managedObjectContext];
 
SCClassDefinition *expenseDef = [SCClassDefinition definitionWithEntityName:@"Expense" withManagedObjectContext:managedObjectContext
withPropertyNames:[NSArray arrayWithObjects:@"amount", @"desc", @"currency", nil]];
// Rename desc to description
SCPropertyDefinition *descPropertyDef = [expenseDef propertyDefinitionWithName:@"desc"];
descPropertyDef.title = @"Description";
 
// Currencies
SCPropertyDefinition *currencyPropertyDef = [expenseDef propertyDefinitionWithName:@"currency"];
currencyPropertyDef.type = SCPropertyTypeSelection;
currencyPropertyDef.attributes = [SCSelectionAttributes attributesWithItems:[NSArray arrayWithObjects:@"$", @"€", @"₤", @"¥", nil]
allowMultipleSelection:NO
allowNoSelection:NO
autoDismissDetailView:YES
hideDetailViewNavigationBar:NO];
 
tableModel = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
 
SCArrayOfObjectsSection *expensesSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil withEntityClassDefinition:expenseDef];
 
expensesSection.addButtonItem = self.navigationItem.rightBarButtonItem;
[tableModel addSection:expensesSection];
}
 
- (void)dealloc {
[tableModel release];
[super dealloc];
}

Re: keyboard question 1 year, 3 months ago #6

Hi again Oscar,

Thanks for the code. The willConfigureCell method is not being called because the cell you're trying to configure is in a detail view model that doesn't have its "delegate" property set to your view controller. Please refer to the following post for the solution: www.sensiblecocoa.com/forum/sensible-tab...t=6&start=6#1825
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
Time to create page: 1.89 seconds