I found a string conversion method in NSNumber, but the code is in objective-C. I tried to convert it to fast, but it does not work.
The code I use
NSNumberFormatter *f = [[NSNumberFormatter alloc] init]; f.numberStyle = NSNumberFormatterDecimalStyle; NSNumber *myNumber = [f numberFromString:@"42222222222"];
and in swift i use it that way
var i = NSNumberFormatter.numberFromString("42")
But this code does not work, what am I doing wrong?
Thank you in advance
ios ios8 swift nsnumber swift-converter
user2413621 Feb 19 '15 at 11:53 2015-02-19 11:53
source share