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

Crystal Ball: Reconnecting Label to Random String

While working on the constraints, I accidentally deleted my label in the Crystal Ball App. I've re-added a label, and named it "It is decidedly so"; I haven't changed any of the code. At this point my label doesn't work with the randomization property already created. I'm trying to review and figure this out, but can someone help point me in the right direction? Thanks.

1 Answer

you are going to need to remove the old outlet connection and then add a new one using the newly created label:

open your .h file of your view controller. make note of what your prediction label is named.

delete the outlet declaration from your .h.

then open your view controller in storyboard and make sure its selected.

open the outlets inspector. find your old prediction label outlet and remove it (click the x).

then open the assistant editor. make sure the viewControllers .h file is open in the assistant editor.

control + click and drag from the label in your storyboard to the .h file. name the label the same name as the old label.

you have now added the new connection. since you named it the same the code you added previously should still work.