0

I am receiving the following error when building a project with the newest project JBJson. Reason?

Unexpected '@' in program

JBJsonStreamParser.m

delegate parser:self foundNumber: @(strtoull(token, NULL, 10))];
4

1 回答 1

0
@( <expression> )

是一个“盒装表达式”,是 Objective-C 的一个相对较新的特性。(有关更多信息,请参阅http://clang.llvm.org/docs/ObjectiveCLiterals.html。)

@(strtoull(token, NULL, 10))

相当于

[NSNumber numberWithUnsignedLongLong:strtoull(token, NULL, 10)]

如果你得到一个编译器错误,那么可能你使用的是 gcc 而不是 clang,或者你的编译器版本太旧。

于 2013-10-20T19:12:41.243 回答