hussion
V2EX  ›  iPhone

ARC下,NSNumber 转换 int 、 float

  •  
  •   hussion · Jan 2, 2014 · 13842 views
    This topic created in 4698 days ago, the information mentioned may be changed or developed.
    在ARC下,为什么NSNumber不允许和int 、 float进行转换?

    编程环境为:ios7的sdk + xcode5
    laihj
    laihj
    Jan 2, 2014
    1
    可以转啊,你怎么转的,转出什么问题了
    wezzard
    wezzard
    Jan 2, 2014
    2
    楼主上代码吧
    icyalala
    icyalala
    Jan 3, 2014
    3
    Show me the code
    wity_lv
    wity_lv
    Jan 3, 2014
    4
    没道理吧··
    NSNumber *number = [NSNumber numberWithInt:1];
    int val = [number integerValue];
    NSLog(@"%@%d", number, val);
    chisj
    chisj
    Jan 3, 2014
    5
    怎么可能!代码拿来看看!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3542 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:02 · PVG 18:02 · LAX 02:02 · JFK 05:02
    ♥ Do have faith in what you're doing.