UA-17470720-3

Jump to content


Photo
- - - - -

SCArrayOfObjectsModel and placeHolderCell


  • Please log in to reply
3 replies to this topic

#1 Urkman

Urkman

    Experienced Member

  • STV 4.0 Pro
  • PipPipPipPip
  • 59 posts
Reputation: 17
Good

Posted 01 July 2013 - 11:26 AM

Hello,

 

why there is no placeholderCell in SCArrayOfObjectsModel?

 

Thanks,

Urkman


  • cratrenue likes this

#2 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 01 July 2013 - 02:07 PM

this should work

    section.modelActions.didAddSection = ^(SCTableViewModel *tableModel, SCTableViewSection *section, NSUInteger sectionIndex)
    {
        SCArrayOfObjectsSection *objectsSection = (SCArrayOfObjectsSection *)section;
        objectsSection.placeholderCell = [SCTableViewCell cellWithText:@"Text" textAlignment:NSTextAlignmentCenter];
    };

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#3 Urkman

Urkman

    Experienced Member

  • STV 4.0 Pro
  • PipPipPipPip
  • 59 posts
Reputation: 17
Good

Posted 01 July 2013 - 10:39 PM

Hello ozie,

 

thanks for your reply, but it will not work.

Because I have no data, the didAddSection Action is not called :(

 

Greetings,

Urkman



#4 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 15 November 2013 - 09:40 PM

ok so today i had the same problem, so i had a think, and this works just fine

 

    obj.modelActions.didFetchItemsFromStore = ^(SCArrayOfItemsModel *itemsModel, NSMutableArray *items)
    {
        if ([items count] == 0) {
            SCArrayOfObjectsSection *s = [SCArrayOfObjectsSection section];
            s.placeholderCell = [SCTableViewCell cellWithText:@"my empty cell text"];
            [itemsModel addSection:s];
        }
    };


P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users