Q:

How to trim off symbols from NSNumber?

Im making an iOS app to do with currency. My app receives the value of maybe: $4. This value the app receives is put into an NSNumber. The trouble is the value actualy has a $ in it. How do I trim out the $ in the NSNumber? Or would I be better of putting it into an NSString?

A:

Use NSNumberFormatter:
// set up your number formatter
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];

// get a string that you'll be converting to a NSNumber
NSString *myNumberString = [NSString stringWithFormat:@"$4"]

// convert then print to the console
NSNumber *myNumber = [numberFormatter numberFromString:myNumberString];
NSLog(@"myNumber: %@", myNumber);

This should accomplish what you're looking to do.  myNumberString will need to be altered to contain whatever string you're receiving.
NSNumberFormatter Documentation:  https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSNumberFormatter_Class/Reference/Reference.html

