UA-17470720-3

Jump to content


Photo
- - - - -

Property or Flag in IB to Show/Hide ArrayOfObjectsCell When Empty


  • Please log in to reply
3 replies to this topic

#1 wizgod

wizgod

    I'm what you guys call a User

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 575 posts
  • LocationThe Grid
Reputation: 149
Popular

Posted 14 September 2015 - 02:58 PM

Greetings Programs!

 

I wouldn't mind having a flag/property that, when set, would display the cell only if there were records in the objects array.

 

Wg

 


P.S. I love Swift... talk Swift.. Never too old school to learn yet another programming language. LOL! ;-)


#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 September 2015 - 06:26 AM

Hey Wg,

 

So if the flag hides the cell, how will you be able to add any new objects to it?

 

Anyways, you can manually remove the cell if you wish using something like the following (code based on our TasksApp sample):

 

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    
    self.tableViewModel.sectionActions.detailModelConfigured = ^(SCTableViewSection *section, SCTableViewModel *detailModel, NSIndexPath *indexPath)
    {
        SCObjectSection *taskSection = (SCObjectSection *)[detailModel sectionAtIndex:1];
        SCArrayOfObjectsCell *stepsCell = (SCArrayOfObjectsCell *)[taskSection cellForPropertyName:@"taskSteps"];
        [taskSection removeCellAtIndex:[taskSection indexForCell:stepsCell]];
    };
}


#3 wizgod

wizgod

    I'm what you guys call a User

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 575 posts
  • LocationThe Grid
Reputation: 149
Popular

Posted 15 September 2015 - 06:59 AM

Hi Tarek,

 

Just trying to be lazier :) ; it's for scenarios where the data is read only.

 

In this case, in the Details, there are no grids so the lazy flag would hide it automagically.

 

Attached File  Simulator Screen Shot Sep 15, 2015, 8.48.44 AM.png   85.22K   10 downloads

 

I suppose I could keep doing it in code; we've just been spoiled with all this IB integration and want more :D.

 

Wg


P.S. I love Swift... talk Swift.. Never too old school to learn yet another programming language. LOL! ;-)


#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 September 2015 - 07:06 AM

ok, we'll look into it :)


  • wizgod likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users