更新时间:2023-02-03 08:33:18
这在Objective-C中是微不足道的......
This is trivial in Objective-C...
NSString *inputString = @"75";
int value = [inputString intValue];
您还可以使用floatValue,doubleValue或(我相信)甚至boolValue将NSString转换为其他类型。这是一个页面,其中列出了您可能需要使用字符串执行的一些常见任务;
You can also use floatValue, doubleValue or (I believe) even boolValue to convert an NSString to other types. Here is a page that lists some common tasks you may need to perform with strings;