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

Now switch to the implementation file. In the 'makeGuess' method, store the text value from 'numberField' in the variable named 'userNumber'.

Would this not work for part step 2? self.numberField.text = userNumber;

3 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

The equals operator assigns values on the right side into variables on the left side. So your line of code is assigning the value in userNumber to the numberField.text property. You just need to switch it around. :)

Thanks, worked like a charm.

Owen Willis
Owen Willis
11,990 Points

I entered:

NSString *userNumber = [self.numberField.text];

Given the code that we were working on in the previous lesson, I think this is correct. Am I missing something?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Took me a minute to find the error! The square brackets are used to indicate method calls, but in your code, you're accessing the text property directly with dot notation. Just get rid of the square brackets and it will work. :)