2015-11-02 58 views
3

當我嘗試從Xcode 7.1中的Xcode 7.0構建項目時出現此錯誤。無法指定'Array <_>'類型的值來鍵入'Array'Xcode 7.1.1

編輯:我仍然有Xcode 7.1.1這個錯誤,即使我評論我的錯誤所在的類的所有代碼。這個問題從哪裏來?你有好主意嗎 ?

我有4個不同類別的錯誤,其中之一是:

import UIKit 

class SubInterestCell: UITableViewCell { 

    private var isSelected:Bool = false 

    @IBOutlet weak var nameLabel: UILabel! 

    override func awakeFromNib() { 
     super.awakeFromNib() 
     // Initialization code 
    } 

    override func setSelected(selected: Bool, animated: Bool) { 
     super.setSelected(selected, animated: animated) 

     // Configure the view for the selected state 
    } 

} 

這怎麼事件可能與此代碼中的錯誤?

編輯:沒有指定行號... enter image description here

我真的堅持了這個問題,我更新了我的手機到iOS 9.1,我無法測試我的應用程序我設備,除了使用測試飛行,但與直接使用Xcode相比是如此之久。 (因爲我使用推送通知,所以模擬器是不夠的)。

有沒有人可以幫助我?我現在很困難。

非常感謝!

有前行完整的錯誤「無法分配..」:

CompileSwift normal arm64 /Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SubInterestCell.swift 
cd /Users/Benobab/Desktop/Comrade-iOS - App 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/MapViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ShowParticipantsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/EventCollectionViewCell.swift" -primary-file "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SubInterestCell.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/RecoveryPasswordViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/RAMAnimatedTabBarController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SubInterestsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/BlockedUserViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SocketMessage.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/NewUserNavigationController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/FeedsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Event.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ExplanationViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/CompleteProfileViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ShowParticipantCell.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ChatViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/DAO_Local.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SignUpViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/DAO_WS.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/InterestsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ProfileViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Token.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SettingsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/LoginViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/UTIL.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SubInterest.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/RAMItemAnimationProtocol.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ChangeSubInterestsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/MyEventsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Interest.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/DAO_Master.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/TabBarViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/RAMBounceAnimation.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/InviteFriendsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/UserType.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/EventMap.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/MyEventsCell.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SwiftyJSON.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/EventViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ExistingUserViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/AppDelegate.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ChangeInterestsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/SwiftAlert.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/CreateEventViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Reachability.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/FirstNavigationViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Choice.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/PushSegueNoAnimation.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/City.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ChangeEventViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/API.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Participation.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/ButtonCell.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/User.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/FirstNavigationController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/RAMRotationAnimation.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/BlockedUserTableViewCell.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/MAPFeedsViewController.swift" "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/WSingleton.swift" -target arm64-apple-ios9.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -I /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Products/Debug-iphoneos -F /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Products/Debug-iphoneos -F /Users/Benobab/Documents/FacebookSDK -enable-testing -g -import-objc-header "/Users/Benobab/Desktop/Comrade-iOS - App/Comrade/Comrade-Bridging-Header.h" -module-cache-path /Users/Benobab/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/swift-overrides.hmap -Xcc -I/Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Comrade.hmap -Xcc -I/Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Products/Debug-iphoneos/include -Xcc -I/Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/DerivedSources/arm64 -Xcc -I/Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc "-working-directory/Users/Benobab/Desktop/Comrade-iOS - App" -emit-module-doc-path /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell~partial.swiftdoc -Onone -module-name Comrade -emit-module-path /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell~partial.swiftmodule -serialize-diagnostics-path /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell.dia -emit-dependencies-path /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell.d -emit-reference-dependencies-path /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell.swiftdeps -o /Users/Benobab/Library/Developer/Xcode/DerivedData/Comrade-azxsewucksmoruaetextyzshdryc/Build/Intermediates/Comrade.build/Debug-iphoneos/Comrade.build/Objects-normal/arm64/SubInterestCell.o -embed-bitcode-marker 
+0

在該行所產生的錯誤?我假設您已經嘗試執行'Product-> Clean'並刪除派生數據文件夾的內容? – courteouselk

+1

是的,我已經嘗試過了,沒有選擇行。我使用cocoapods的一些框架,也許這是問題的根源,但所有工作正常與Xcode 7 :(見我只是添加在帖子上的圖片) – Benobab

+0

什麼在你的'MapViewController.swift'? – courteouselk

回答

0

我看不到你的代碼,但盡力幫助。有時編譯器無法檢測到錯誤行,這是一個編譯器錯誤。在你的情況下,它不是你的代碼中的錯誤。 Here is a pseudo code to fix the problem:

如果陣列的聲明是這樣的:

let k: String = "king" 
let q: String = "queen" 
let j: String = "jack" 

var card: [String] = [k, q, j] 

var cardsArray = card 

替換cardsArray=card有:

var cardsArray: Array<String> = card 
+0

類型註釋的愚蠢的好例子。將其替換爲'var cardsArray = [Card]()' – vadian

相關問題