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
james white
78,399 Pointswe need to conform to the UITextFieldDelegate protocol. Change the header file to conform to this protocol.
Dismissing the Keyboard Challenge: http://teamtreehouse.com/library/dismissing-the-keyboard
Challenge Task 1 of 4
In this app we are recording details of different types of teas. To manipulate the keyboard and respond to events, we need to conform to the UITextFieldDelegate protocol. Change the header file to conform to this protocol.
Forgive me if there is another forum thread about this, but I couldn't find one..
I searched around an found this StackOverFlow thread: http://stackoverflow.com/questions/8735399/uitextfielddelegate-protocol-changed-between-ios-4-3-and-5-0-whats-happening
..which had a line that looked promising:
@interface ViewController : UIViewController <UITextFieldDelegate>
..but I passed it in and it didn't work!
Then I realized there was another @interface line:
@interface TeaDetailViewController : UIViewController
So I decided to merge them together into:
@interface TeaDetailViewController : UIViewController <UITextFieldDelegate>
.and lo and behold it passed. Hope this helps some other people..
For the other parts of the challenges, here's some cross referencing of other threads I found helpful:
For Challenge 2 of 4: https://teamtreehouse.com/forum/solved-code-challenge-dismissing-your-keyboard-help
For both Challenges 3 & 4: https://teamtreehouse.com/forum/code-challenge-dismissing-the-keyboard-task-3-of-4