判断NSString是NSInteger还是float?
方法很多,无意间在Stack Overflow到此方法特此标记:就是用NSNumber处理
NSNumber* n = //from somewhere
if(strcmp([n objCType],@encode(float))==0)
{
NSLog(@"this is a float");
}else if(strcmp([n objCType],@encode(int))==0)
{
NSLog(@"this is an int");
}