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 895667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:35:46+00:00 2026-05-15T14:35:46+00:00

I want to convert NSString to NSNumber without using numbreFromString: method? The numbreFromString: metgod

  • 0

I want to convert NSString to NSNumber without using numbreFromString: method? The numbreFromString: metgod is acting weirdly in 4.0. So i want to use an alternative to convert NSString to NSNumber. Please Help me….

+ (NSString *)formatText:(NSString *) text withLocalSettings:(BOOL) isLacale {  

    NSNumber *aNsNumber= [numberFormatter numberFromString: text];  
    NSString *returnString = [NSString stringWithString:[numberFormatter stringForObjectValue:aNsNumber]];

    if(isLacale) {
        return returnString;
    }
    else {
        return [NSString stringWithFormat:@"%lf",[aNsNumber doubleValue]];
    }
} 

0

I am developing an application i need to run my app both in 3.0 and 4.0. I have a textfield where when i try to enter numbers in the textfield the behaviour is like this… IN 3.0 :- It allows to enter 7 digits and 2 fractional values (I have formatted it like this). I have formatted and localized the numbers along with the comma seperations depending on the country selected. It is working perfectly in 3.0 and 3.1.2

IN 4.0 : – It allows you to enter only 4 numbers and after entering 5th digit it is making the textfields empty.. Nothing is displayed when u enter the 5th number and when u enter the 6th number it starts from the 1st number and continues the same til 4 numbers. ex: – when u enter 1234, textfield appears – 1234 and when u enter 12345, textfield appears ” “. and when u enter 6 now it starts with 6 and so on..

I am using the NSNumberFormatter and numberfromstring method to format the values entered in the textfield.

I am not able to understand why this is happening like this… Please help me…

  • 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-05-15T14:35:46+00:00Added an answer on May 15, 2026 at 2:35 pm
    [NSNumber numberWithInteger:[theString integerValue]];
    [NSNumber numberWithDouble:[theString doubleValue]];
    

    also floatValue, intValue, longLongValue, boolValue

    Edit:

    to strip out commas, use stringByReplacingOccurrencesOfString before doing the above.

    theString = [theString stringByReplacingOccurrencesOfString:@"," withString:@""];
    

    to strip out more than one character, you could get something working with componentsSeparatedByCharactersInSet.

    theSet = [NSCharacterSet characterSetWith...];
    theString = [[theString componentsSeparatedByCharactersInSet:theSet] componentsJoinedByString:@""];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 486k
  • Answers 486k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best "rule of thumb" to work by is: If… May 16, 2026 at 8:09 am
  • Editorial Team
    Editorial Team added an answer The cleanest way to do this, or to do other… May 16, 2026 at 8:09 am
  • Editorial Team
    Editorial Team added an answer It isn't. It has several options for memory statistics (use… May 16, 2026 at 8:09 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.