问题:
I was going through the release notes for Xcode 4.4 and noticed this:我正在浏览 Xcode 4.4 的发行说明并注意到这一点:
LLVM 4.0 Compiler LLVM 4.0 编译器
Xcode now includes the Apple LLVM Compiler version 4.0, including the following newObjective-C language features: [...] Xcode 现在包含 Apple LLVM 编译器 4.0 版,包括以下新的Objective-C 语言特性:[...]
- Objective-C literals: create literals for NSArray, NSDictionary, and NSNumber, just the same as the literals for NSString - Objective-C 文字:为 NSArray、NSDictionary 和 NSNumber 创建文字,与 NSString 的文字相同
I'm intrigued about this feature.我对这个功能很感兴趣。 It's not entirely clear to me just how literals for NSString
work and how one could use them on NSArray
, NSDictionary
, and NSNumber
.我并不完全清楚NSString
文字是如何工作的,以及如何在NSArray
、 NSDictionary
和NSNumber
上使用它们。
What are the details?详情是什么?
解决方案:
参考一: https://en.stackoom.com/question/dDli参考二: https://stackoom.com/question/dDli