4

我所拥有的是 a NSNumber,它是在 中创建的,AppDelegate并且持有 anumberWithBool:TRUE和 a ViewController,应该在其中进行比较。

我的问题是,ViewController不承认 myNSNumber设置为1。调试器证明NSNumber确实设置为1但没有发生任何事情。

if([appDelegate.gotUrl isEqualToNumber:[NSNumber numberWithBool:TRUE]])
{
    //will do nothing
}

我的问题有什么解决方案吗?

提前致谢

4

1 回答 1

5
if([appDelegate.gotUrl boolValue])
{
    // might do something
}
于 2012-10-17T13:45:51.193 回答