問題:
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