2017-06-18 52 views
0
我使用的Xcode

在應用程序線程斷點,我使用的語言是斯威夫特3,我發現這個問題在第39行「斷點」線有適​​用於iOS

class ViewController: UIViewController { 

    @IBOutlet weak var NameTextLabel: UILabel! 
    @IBOutlet weak var ExplainTextLabel: UILabel! 
    @IBOutlet weak var PriceTextLabel: UILabel! 
    @IBOutlet weak var FeaturesTextLabel: UILabel! 

    let Features = ["Features Include: Siri acts as a musicologist, Advanced searches..., Works with Apple Music, etc", " Feautres Include: Up to 18 Cores, Thunderbolt 3, 5k Display, etc", 
     "Feautres Include: AR technology, I messages wont take up storage, A redesinged appstore, etc", "New Faces, Siri Face, Better Pairing Process"] 

    let Explain = ["Apple Smart Speaker", "Most Powerfull Mac", "The New OS", "Watch OS4"] 

    let Price = ["At $349", "At $4999", "Free", "Free"] 

    let Name = ["Homepod", "iMac Pro", "iOS 11", "Watch OS4"] 

    @IBAction func MoreDidTap(sender: AnyObject) { 

     let randomNumber = Int(arc4random()) % 4 

     let NewName = Name [randomNumber] 
     let NewExplain = Explain [randomNumber] 
     let NewPrice = Price [randomNumber] 
     let NewFeatures = Features [randomNumber] 

     NameTextLabel.text = NewName 
     ExplainTextLabel.text = NewExplain 
     PriceTextLabel.text = NewPrice 
     FeaturesTextLabel.text = NewFeatures (This line has a thread breakpoint can anyone help) 
    } 

} 
+0

而你想刪除斷點?您之前是否搜索過https://stackoverflow.com/search?q=xcode+remove+breakpoint? –

回答

0

我懷疑你'即使你沒有在線上手動設置斷點,Xcode仍然停留在該行上。

我的猜測是你沒有掛在你的故事板的FeaturesTextLabel插座。嘗試在第39行之前放置print(FeaturesTextLabel)。輸出是什麼?如果是nil,則插座未連接。

+0

Im對不起,我真的沒有用Xcode expirienced在哪裏可以找到輸出? –

0

當應用程序由於UIBontrols在Xib/Storyboard中的綁定不正確而崩潰時,會發生此行爲。重新檢查你的綁定。