UA-17470720-3

Jump to content


Photo
- - - - -

Object Selection Cell Detail View Generation missing?

models cells

  • Please log in to reply
3 replies to this topic

#1 fabiensen

fabiensen

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 23 posts
Reputation: 5
Good

Posted 30 April 2015 - 01:57 AM

Hi all!

 

managing a MtoM relationship I need a cell as Object Selection Cell. In this way, I can access another tableview where I can manage this relationship.

 

However I notice that in IB the button Generate Detail View is missing, and this is the only case (I used it for example for Array of Objects Cell).

 

Is there a reason why this is missing? Unfortunately, I can't properly style the related detailed view if this button is missing, as I don't have the Xib in IB. 

 

Thanks for your kind support!

Regards

 

Fabio Ricci

 

 



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 30 April 2015 - 05:38 AM

Hi Fabio,

 

All selection cells generate the item selection detail views on the fly and don't have an IB generate button. The styling should be very easy to do via cellActions. What kind of styling are you trying to achieve?



#3 fabiensen

fabiensen

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 23 posts
Reputation: 5
Good

Posted 30 April 2015 - 06:00 AM

Hi Tarek,
 
I attach two screenshots. In the first one you will see that in the right panel I could generate a Detail View. While in the second screenshot I simply can't generate a Detail View. In the first case I have a "xib" to work on, in the second case not... So, why are these two sections different and how can I generate details also in the second case to style it?

 

Thanks!!!

Fabio

 

screen1.png

 

screen2.png



#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 30 April 2015 - 11:14 AM

Hi Fabio,

 

Since selection cells only generate their UI at runtime, you should be styling them via either theme files or through cellActions. The following is an example of how to style using cellActions:

 

// MasterViewController.m

- (void)viewDidLoad
{
  ...
    SCDataDefinition *clienteDef = [self dataDefinitionWithIBName:@"Cliente"];
    SCPropertyDefinition *prefPropertyDef = [clienteDef propertyDefinitionWithName:@"preferenzeRel"];
    prefPropertyDef.cellActions.detailModelConfigured = ^(SCTableViewCell *cell, NSIndexPath *indexPath, SCTableViewModel *detailModel)
    {
        detailModel.cellActions.willDisplay = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
        {
            cell.backgroundColor = [UIColor yellowColor];
            // etc
        };
    };
  ...
}

 

 

We could also study in a future STV version to change the nature of selection cells so that their detail views could be generated in IB too. Hope this helps.







Also tagged with one or more of these keywords: models, cells

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users