V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hussion
V2EX  ›  iPhone

ARC下,NSNumber 转换 int 、 float

  •  
  •   hussion · 2014 年 1 月 2 日 · 12404 次点击
    这是一个创建于 4394 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在ARC下,为什么NSNumber不允许和int 、 float进行转换?

    编程环境为:ios7的sdk + xcode5
    laihj
        1
    laihj  
       2014 年 1 月 2 日
    可以转啊,你怎么转的,转出什么问题了
    wezzard
        2
    wezzard  
       2014 年 1 月 2 日
    楼主上代码吧
    icyalala
        3
    icyalala  
       2014 年 1 月 3 日
    Show me the code
    wity_lv
        4
    wity_lv  
       2014 年 1 月 3 日
    没道理吧··
    NSNumber *number = [NSNumber numberWithInt:1];
    int val = [number integerValue];
    NSLog(@"%@%d", number, val);
    chisj
        5
    chisj  
       2014 年 1 月 3 日
    怎么可能!代码拿来看看!
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3069 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 13:50 · PVG 21:50 · LAX 05:50 · JFK 08:50
    ♥ Do have faith in what you're doing.