Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift 2.0 Structs as Data Models Creating a Data Collection

Pressing the "Show another fun fact" button doesn't change text

Whenever I press the button we created, the label does not change.

Instead, i get send back to the editor, with the following line highlighted:

let facts = ["Ants stretch when they wake up in the morning", "Ostriches can run faster than horses"]

And on the right, there is a notice of sorts that says:

Thread 1: breakpoint 1.1

Can anyone tell me why this is happening, and how to fix it?

Thank you in advance!

3 Answers

xiaoluke
xiaoluke
6,387 Points

Hi you have accidentally clicked on the line number and set a break point in your code. (you will see a little blue arrow on that line of code) What this does it run the code until that point and then stop it.

Simply just click that blue arrow again and it turns it off.

I did this a lot when I first started with xcode.

That was absolutely it. Thank you so much!

If you don't mind me asking, in what situations would I want to set a break point?

xiaoluke
xiaoluke
6,387 Points

I've never had to do it myself yet, but I believe it is to with debugging.

https://en.wikipedia.org/wiki/Breakpoint probably gives a better explanation than I can.

Alright, I'll read up on it. Thanks again!