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-12-28 16:27:56
int i=100;
float f=2.34;
NSNumber *n1=[NSNumber numberWithInt:i];
NSNumber *n2=[NSNumber numberWithFloat:f]
将NSNumber类型转换成基本类型
i=[n1 intvalue]
f=[n2 floatValue];