Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Simple iPhone App with Swift Creating a Data Model Finishing Up Our Model

Keep having a breakpoint error after returning showFunFacts()

My code seems exactly similar to the one on the course but it keeps returning a breakpoint. I tried debugging with some println() but the breakpoint is still there.

The 'funFactLabel.text = factBook.randomFact()' seems to be working as the first fact is randomized properly when the app is launched....

Thanks

Code below :

'class ViewController: UIViewController { @IBOutlet weak var funFactLabel: UILabel!

let factBook = FactBook()

override func viewDidLoad() {
    super.viewDidLoad()
    funFactLabel.text = factBook.randomFact()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}


@IBAction func showFunFacts() {
    funFactLabel.text = factBook.randomFact()
}

}'

1 Answer

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Do you have a break point without knowing it? Look in the gutter on the left side of the code.