UA-17470720-3

Jump to content


Photo
- - - - -

SCClassDefinition is not applied to SCObjectSection

sections data-definitions

  • Please log in to reply
1 reply to this topic

#1 oscar.anton

oscar.anton

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 6 posts
Reputation: 0
Neutral

Posted 25 February 2014 - 08:33 AM

Hi, this is my viewDidLoad method:

 

- (void)viewDidLoad

{

    [super viewDidLoad];

// Do any additional setup after loading the view.

    self.usuario = [[SMUsuario alloc] init];

    

    self.tableView.delegate =self;

    self.tableViewModel.delegate = self;

    

    SCClassDefinition *definitions = [[SCClassDefinition alloc] initWithClass:[SMUsuario class] autoGeneratePropertyDefinitions:TRUE];

    

    [definitions propertyDefinitionWithName:@"nombre"].required = TRUE;

    [definitions propertyDefinitionWithName:@"apellidos"].required = TRUE;

    

    SCPropertyDefinition *emailDef = [definitions propertyDefinitionWithName:@"email"];

    emailDef.required = TRUE;

    emailDef.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath)

    {

        SCTextFieldCell *textFieldCell = (SCTextFieldCell *)cell;

        textFieldCell.textField.keyboardType = UIKeyboardTypeEmailAddress;

        textFieldCell.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;

        textFieldCell.enabled = NO;

    };

    

    

    SCPropertyDefinition *passDef = [definitions propertyDefinitionWithName:@"password"];

    passDef.required = TRUE;

    

    passDef.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath)

    {

        SCTextFieldCell *textFieldCell = (SCTextFieldCell *)cell;

        textFieldCell.textField.secureTextEntry = YES;

        //textFieldCell.boundPropertyName = @"oldPass";

    };

    

 

    

    

    SCObjectSection *userSection = [[SCObjectSection alloc] initWithHeaderTitle:@"Datos de Usuario" boundObject: self.usuario boundObjectDefinition:definitions ];

   [self.tableViewModel addSection:userSection];

    

}

 

My  SCTableViewController ignores completly my SCClassDefinition  when controller loads.

 

Someone knows why?

 

Thank you.

 



#2 oscar.anton

oscar.anton

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 6 posts
Reputation: 0
Neutral

Posted 25 February 2014 - 08:56 AM

I found the problem:

 

    self.tableView.delegate =self;

    self.tableViewModel.delegate = self







Also tagged with one or more of these keywords: sections, data-definitions

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users