int i=100;
float f=2.34;
NSNumber *n1=[NSNumber numberWithInt:i];
NSNumber *n2=[NSNumber numberWithFloat:f]
将NSNumber类型转换成基本类型
i=[n1 intvalue]
f=[n2 floatValue];
时间: 2024-10-25 10:11:13
int i=100;
float f=2.34;
NSNumber *n1=[NSNumber numberWithInt:i];
NSNumber *n2=[NSNumber numberWithFloat:f]
将NSNumber类型转换成基本类型
i=[n1 intvalue]
f=[n2 floatValue];