簡體   English   中英

Lister示例項目-Swift版本的構建錯誤

[英]Lister sample project - build errors with the Swift version

我從蘋果公司下載了Lister“生產力應用程序”(1.4版,2014-10-16)示例項目:

https://developer.apple.com/library/ios/samplecode/Lister/Introduction/Intro.html#//apple_ref/doc/uid/TP40014701

我在OS X 10.10(Yosemite)上運行了Xcode 6.0.1。 Objective-C版本運行良好。 Swift版本的構建失敗,出現四個錯誤:

  1. /Users/ben/Downloads/ListerAProductivityAppObj-CandSwift/Swift/ListerKit/ListDocument.swift:61:114:“List.Color”沒有名為“ rawValue”的成員

  2. /Users/ben/Downloads/ListerAProductivityAppObj-CandSwift/Swift/ListerKit/ListUtilities.swift:103:31:條件綁定中的綁定值必須為Optional類型

  3. /Users/ben/Downloads/ListerAProductivityAppObj-CandSwift/Swift/Common/List.swift:126:22:無法構建'List.Color',因為它沒有可訪問的初始化程序

  4. /Users/ben/Downloads/ListerAProductivityAppObj-CandSwift/Swift/Common/List.swift:131:30:“List.Color”沒有名為“ rawValue”的成員

我想知道為什么示例項目沒有開箱即用地編譯? 根據README.md

該項目被列為需要Xcode 6.1或更高版本。 發生了一些變化,其中之一是枚舉的原始值是通過rawValue屬性獲得的,而在6.0.x中是通過toRaw()方法獲得的。

其他錯誤很可能是由類似的更改引起的。

因此,我建議您下載最新的6.1 GM版本,該版本仍未在appstore中提供(盡管它被列為“不久將可用”),因此您必須從iOS / MacOS開發中心手動下載

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM