UA-17470720-3

Jump to content


Photo
- - - - -

how to avoid empty value from SCPropertyTypeTextField

sections cells actions view-controllers general

  • Please log in to reply
3 replies to this topic

#1 Balachandhar

Balachandhar

    Experienced Member

  • STV 3.0 Pro
  • PipPipPipPip
  • 87 posts
Reputation: 21
Excellent

Posted 13 June 2014 - 04:02 AM

Hi all,

 

I want to restrict the empty values from required field. I am using  tasktextPropDef.required = TRUE; to get the required field value but it can work with empty spaces.

 

I would like to restrict only with texts instead empty spaces.

 

kindly let me know if anyone know a way for the same.

 



#2 ozie

ozie

    ¯\_(ツ)_/¯

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

Posted 13 June 2014 - 07:48 PM

test before inserting

 

            obj.sectionActions.willInsertItem = ^BOOL(SCArrayOfItemsSection *itemsSection, NSObject *item, SCTableViewModel *itemModel)
            {
                if item.field.trim.length == 0
                   return FALSE;

                // else Accept insert
                return TRUE;
            };

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


#3 Balachandhar

Balachandhar

    Experienced Member

  • STV 3.0 Pro
  • PipPipPipPip
  • 87 posts
Reputation: 21
Excellent

Posted 16 June 2014 - 12:56 AM

how can i check it only for particular field i.e required field alone?  for e.g. I would like to check only for the name field.



#4 ozie

ozie

    ¯\_(ツ)_/¯

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

Posted 16 June 2014 - 01:03 AM

[item valueForKey:@"name"]

  • Balachandhar likes this

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






Also tagged with one or more of these keywords: sections, cells, actions, view-controllers, general

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users