Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: KeyboardType

KeyboardType 1 year, 8 months ago #1

I did a quick search but it didn't throw up anything...

Is there an easy way to specify the keyboardType for a SCTextFieldCell?

Cheers,

Mike.
  • mike
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0

Re: KeyboardType 1 year, 8 months ago #2

Hi Mike:

An SCTextFieldCell holds a normal UITextField that could have its keyboard type set as follows:

 
...
myTextFieldCell.textField.keyboardType = ...; // any UIKeyboardType here
...
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: KeyboardType 1 year, 8 months ago #3

Cheers, thanks!

Enjoying it so far... Any sign of xib support for cells?

Mike.
  • mike
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0

Re: KeyboardType 1 year, 8 months ago #4

You're welcome Mike

Please check out this post: www.sensiblecocoa.com/forum/sensible-tab...ell-from-xib.html#98
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: KeyboardType 10 months, 3 weeks ago #5

Perhaps I'm rusty, but how do I get the cell for an autogenerated object?
I have a coredata field that's a string, but I want numeric input only. So I want to change to the number keypad.

Thanks

Re: KeyboardType 10 months, 3 weeks ago #6

Hi Seth,

Assuming you're talking about an auto generated SCObjectSection in a detail view, here is basically what you should be doing:

 
// called for new objects
- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForSectionAtIndex:(NSUInteger)index withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
SCObjectSection *objectSection = (SCObjectSection *)[detailTableViewModel sectionAtIndex:0];
SCTextFieldCell *textFieldCell = (SCTextFieldCell *)[objectSection cellForPropertyName:@"myPropertyName"];
textFieldCell.textField.keyboardType = UIKeyboardTypeNumberPad;
}
 
// called for detail views of existing objects
- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForRowAtIndexPath:(NSIndexPath *)indexPath withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
[self tableViewModel:tableViewModel detailViewWillAppearForSectionAtIndex:index withDetailTableViewModel:detailTableViewModel];
}
 


Hope this helps!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Last Edit: 10 months, 3 weeks ago by tarekskr.
  • Page:
  • 1
Time to create page: 1.69 seconds