2017-06-09 5 views
0

私はElementQuizアプリを、 "App Development with Swift"(iBooksから)を使ってビルドしようとしています。私がアプリケーションを実行すると、クラッシュしてAppDelegateページに行き、 "スレッド1:ブレークポイント1.4"という緑色の線が表示されます。ここでElementQuiz app-thread 1:breakpoint 1.4

はViewController.swiftです:

//AppDelegate.swift 
//ElementQuiz 

import UIKit 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

    // This is the line with the "signal SIGABRT" error. 
    var window: UIWindow? 

    func application(_application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 

     //Override point for customization after application launch. 
     return true 
    } 
} 

私のコードだった:

// ViewController.swift 

// ElementQuiz 

import UIKit 

class ViewController: UIViewController { 
    override func viewDidLoad() { 
     super.viewDidLoad() 
     updateElement() 
    } 

    @IBOutlet weak var image view: UIImageView! 

    @IBOutlet weak var answerLabel: UILabel! 

    @IBAction func showAnswer(_sender: Any) { 
     answerLabel.text = elementList[currentElementIndex] 
    } 

    @IBAction func gotoNextElement(_sender: Any) { 
     currentElementIndex += 1 
     if currentElementIndex >= elementList.count { 
     currentElementIndex = 0 
     } 

     updateElement() 
    } 

    let elementList = ["Carbon", "Gold", "Chlorine", "Sodium"] 

    var currentElementIndex = 0 

    func updateElement() { 
     answerLabel.text = "?" 

     let elementName = elementList[currentElementIndex] 
     let image = UIImage(named: elementName) 
     imageView.image = image 
    } 
} 

そして、ここではAppDelegate.swiftです。

+0

おそらくhttps://stackoverflow.com/questions/32038226/error-thread-1-breakpoint-2-1とhttps://stackoverflow.com/questions/10016890/threadの重複-1-stop-at-break-point-error-initialize-n-nsurl-object - ブレークポイントを削除するか、デバッガメニューから「continue」を選択するだけです。 –

答えて

0

すべての接続をここで削除します(画像参照)。あなただけがこの接続を持っています。

connection event

関連する問題