Today we are going to get the "Tweet it!" button to do something, like talk to Twitter. We are not sure how to do it, but the HeadFirst book will tell us. However, it makes us think about it first before giving us the answers.
Apparently, we learn better when we are made to think :-)
The first step was to hook up the "Tweet it!" button using what we've learned in Chapter 1.
There are two parts to hooking up the button: linking it in Interface Builder, coding it up in the .m file. The first step was to make sure tapping the button actually did something. The time-tested way to do that is to write out a message to a logfile.
In this case, the suggestion was to write it out to the Debug Console via the NSLog method.
The next thing we need to do is, when the button has been pressed, to extract the information from the two dials on the picker, create a string containing those values, and send it off to Twitter. This, we will do, using a mechanism we learned in Chapter 1. The mechanism is call the IBOutlet. It is a way to extract data from one place and hand it off to somewhere else. We'll post more tomorrow about it. [Permalink] -HeadFirst iPhone Development: Chapter 2