NSNumberFormatter *numFormatter = [[NSNumberFormatter alloc] init]; NSNumber *firstNum = [NSNumber numberWithInt:2]; //NSNumber 转为 NSString NSString *firstStr = [numFormatter stringFromNumber:firstNum]; //NSString 转为 NSNumber NSNumber *secondNum = [numFormatter numberFromString:firstStr]; [numFormatter release];
时间: 2024-10-14 06:16:34