UA-17470720-3

Jump to content


Photo
- - - - -

Adding Currency Input Text Field Utilizing STV 4.0.5

data-definitions view-controllers xcode general feature-request models

  • Please log in to reply
4 replies to this topic

#1 jet21

jet21

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 10 December 2014 - 04:07 PM

Hello,

 

I'm currently working on an App utilizing STV 4.0.5. I'm using Parse data definition as well. One of my text fields requires a currency input: $00.00. What would be the best approach to applying an NSNumberFormatter to a text field in my Parse data definition? 

 

Also, is there a more efficient way to accomplish this utilizing STV 4.0.5?

 

Thanks....



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 11 December 2014 - 08:19 AM

Hi,

 

Have you created your Parse definition in code or Interface Builder?



#3 jet21

jet21

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 11 December 2014 - 11:05 AM

Hi,

 

Have you created your Parse definition in code or Interface Builder?

Yes, interface builder.



#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 11 December 2014 - 01:59 PM

You can easily configure the definition's associated number formatter in the following manner:

 

SCDataDefinition *myParseDef = [self dataDefinitionWithIBName:@"Task (Current User)"]; // provide the data definition name here exactly as it appears in IB
SCPropertyDefinition *myCurrencyProperty = [myParseDef propertyDefinitionWithName:@"myCurrencyProperty"];
[(SCNumericTextFieldAttributes *)myCurrencyProperty.attributes numberFormatter].numberStyle = NSNumberFormatterCurrencyStyle; // etc

 

Hope this helps.



#5 jet21

jet21

    Jr. Member

  • STV 4.0 Std
  • PipPip
  • 18 posts
Reputation: 0
Neutral

Posted 11 December 2014 - 07:47 PM

You can easily configure the definition's associated number formatter in the following manner:

 

SCDataDefinition *myParseDef = [self dataDefinitionWithIBName:@"Task (Current User)"]; // provide the data definition name here exactly as it appears in IB
SCPropertyDefinition *myCurrencyProperty = [myParseDef propertyDefinitionWithName:@"myCurrencyProperty"];
[(SCNumericTextFieldAttributes *)myCurrencyProperty.attributes numberFormatter].numberStyle = NSNumberFormatterCurrencyStyle; // etc

 

Hope this helps.

Thanks again, Tarek! I will try it...







Also tagged with one or more of these keywords: data-definitions, view-controllers, xcode, general, feature-request, models

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users