【问题标题】: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];
    

    【讨论】:

      猜你喜欢
      • 2012-03-28
      • 2012-04-30
      • 2011-12-27
      • 2010-10-30
      • 2011-04-16
      • 2013-08-02
      • 2011-03-25
      • 1970-01-01
      相关资源
      最近更新 更多