Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8263211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:01:22+00:00 2026-06-08T04:01:22+00:00

I have created a nib file with a normal IBOulet for a NSTextField .

  • 0

I have created a nib file with a normal IBOulet for a NSTextField.
In IB (4.4), add a NSNumberFormatter for this NSTextField and give this some properties, like Decimal Style, max and min values, etc.

Now, I want to modify in code, some other properties for this NSNumberFormatter already embedded in the textfield, like SetGroupingSeparator, SetMaximunFractionDigits etc.

Let say my NSTextField is named pf,
normally I can access the value (string) in the cell as:

[pf SetFloatValue]

or

myFloat = [pf floatValue].

That is working without any problems.
However, I have been unable to find in the documentation or anywhere an example how to modify the NSNumberFormatter properties in code.
I know how to create a NSNumberFormatter in code, but do not know how to assign it to the NSTextField (which I don’t know if will overrides the one create in IB).
Could anyone help me with a clear example how to do this?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:01:23+00:00Added an answer on June 8, 2026 at 4:01 am

    To create and set a NSNumberFormatter to a NSTextField in code can be done via:

    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    [[textField cell] setFormatter:numberFormatter];
    

    The details for which I found in Apple’s Data Formatting Guide

    Modifying a formatter should be pretty similiar, accessing the formatter via [NSCell formatter]:

    NSNumberFormatter * numberFormatter = [[textField cell] formatter];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a UIView object using the contents of a NIB file like
I have a nib file. In this I created a new custom view (of
This is a weird issue. I have created a view controller with a nib
I have a RootViewController & it's associated nib or xib file. This nib is
I have a button that's created via a NIB file. I've derived a class
I have UItableViewCell created with a nib file, and have put in my cell
I have created a view MyView in the nib file MyNib My question is
I have created a UITableViewCell with a NIB file. There is 1 label in
I have a simple UIViewController whose view is created via a Nib. Here's the
I have my ipad code created programmatically not using nib.I converted my ipad app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.