博客> iOS 常用类型转换 NSString int float double的转换
iOS 常用类型转换 NSString int float double的转换
2018-05-22 04:18 评论:0 阅读:655 callmezou
ios NSString 类型转换 int double float

1.int——>NSString int a = 100; NSString *b = [NSString stringWithFormat:"%d",a];

2.NSString——>int NSString *a = @"100"; int num = [a intValue];

3.NSString——>float NSString *a = @"100"; float num = [a floatValue];

4.3.NSString——>double NSString *a = @"100"; double num = [a doubleValue];

收藏
0
sina weixin mail 回到顶部