【问题标题】:How can I convert a string to an integer in Objective-C? [duplicate]如何在 Objective-C 中将字符串转换为整数? [复制] 【发布时间】:2012-12-08 05:32:53 【问题描述】: 可能重复:How to do string conversions in Objective-C? 如何在 Objective-C 中将字符串转换为整数? 【问题讨论】: 标签: objective-c 【解决方案1】: int value = [string intValue]; 【讨论】: 【解决方案2】: NSInteger value=[string integerValue]; 【讨论】: