这是目标 c 中强制转换运算符的正确用法:
//casting an int to float
int a = 1;
float b = (float) a;
为什么我不能使用以下内容将 int 转换为 nsstring:
int a = 1;
NSString *c = (NSString *)a;
//I receive the error : "cast of 'int' to 'nsstring' is disallowed with ARC"
执行上述操作在概念上有什么问题?
PS 我已经知道我应该使用 "c= [NSString stringWithFormat:@"%i",a];"!