NSString NSNumber 相互转化
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];