-(int)intValue;//字符串转换为整型;
-(float)floatValue;//字符串转换为浮点型.
-(BOOL)boolValue;//字符串转换为布尔值类型.
{NSInteger integerNumber = 888;
NSString * string = [NSString stringWithFormat:@"%d",integerNumber]; }//整型转换为字符串
NSNumber和NSValue//将基本数据类型转换为数值对象
+(NSNumber *)numberWithChar:(char)value;
+(NSNumber *)numberWithInt:(int)Value;
+(NSNumber *)numberWithFloat:(float)Value;
+(NSNumber *)numberWithBool:(bool)Value;
-(char)charValue;//把已经封装好的NSNumber的对象转换为基本数据类型char;
-(int)intValue;
-(float)floatValue;
-(BOOL)boolValue;
-(NSString *)stringValue;
NSValue的一些用法
+(NSValue *)valueWithPoint:(CGPoint)point;
+(NSValue *)valueWithSize:(CGSize)size;
+(NSValue *)valueWithRect:(CGRect)rect;
-(CGPoint)pointValue;
-(CGSize)sizeValue;
-(CGRect)rectValue;
转载请注明本文源地址:http://blog.csdn.net/u013082522/article/details/18562659