【发布时间】:2012-06-26 18:10:34
【问题描述】:
我正在尝试在 NSValue / NSConcreteValue 实例中提取一个 int。我试图以这种方式投射它们,但它不起作用:
NSValue *toValue = (NSValue *)someValue;
NSNumber *toNumber = (NSNumber*)toValue;
int final = [toNumber intValue];
我也尝试过使用getValue,但这对我也不起作用。
【问题讨论】:
-
someValue原来是什么?你为什么要把它投射到NSValue?当您说“没用”时,您收到了什么错误?
标签: ios ios5 core-foundation nsvalue