What does it mean when you put an @ before an inte

2019-04-29 11:10发布

问题:

What does it mean when you put an @ before an integer in Objective-C? Like so:

@4

回答1:

It is the NSNumber literal. A shortcut for this:

[NSNumber numberWithInt:4];