下載Xcode 8並遷移到Swift 3後,我不再能夠歸檔該項目。同時該項目建設沒有任何問題。未定義的符號Swift.UnsafeMutableBufferPointer
錯誤,我得到:
Undefined symbols for architecture armv7:
"Swift.UnsafeMutableBufferPointer.(subscript.materializeForSet : (Swift.Int) -> A).(closure #1)", referenced from: function signature specialization of generic specialization with Swift.UnsafeMutableBufferPointer : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer : Swift.RandomAccessCollection in Swift> of Swift._siftDown (inout A, index : A.Index, subRange : Swift.Range, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) ->() in OrderCoordinator.o function signature specialization of generic specialization with Swift.UnsafeMutableBufferPointer : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer : Swift.RandomAccessCollection in Swift> of Swift._heapSort (inout A, subRange : Swift.Range, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) ->() in OrderCoordinator.o function signature specialization of generic specialization with Swift.UnsafeMutableBufferPointer : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer : Swift.RandomAccessCollection in Swift> of Swift._partition (inout A, subRange : Swift.Range, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> A.Index in OrderCoordinator.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
我能夠通過註釋數組中的以下功能分類代碼擺脫錯誤的:
func didFinishWithResults(_ results: [PhotoProcessorResult]) {
guard let album = albumService.currentAlbum else { return }
//let sortedResults = results.sorted(by: { $0.fileIndex < $1.fileIndex })
let updateItems = zip(sortedResults, album.assetItems).map { (photoProcessorResult, assetItem) -> UpdateItem in
UpdateItem(path: photoProcessorResult.filePath, position: photoProcessorResult.fileIndex, isCover: assetItem.isCover)
}
albumService.updateAlbumWithItems(updateItems) { (success, errorDescription) in
if success {
self.handleAlbumUpdate()
} else {
self.showFailureAlert(errorDescription) {
self.startProcessingAlbum(self.albumService.currentAlbum)
}
}
}
}
雖然我使用的NSArray排序數據解決的問題,我不喜歡這個解決方案。
將不勝感激的任何建議。
在更改之前發佈您的代碼也 – Kuba