Wednesday, February 18, 2009

iPhone Journal II

Today, I planned to look over more programming documentation, to work through chapters 5 (Autorotation and Autosizing) and 6 (Multiview Applications) in Beginning iPhone Development: Exploring the iPhone SDK, and to create an example program demonstrating my knowledge. Since I spent much of the morning uploading my first journal entry in various formats and underestimated the technical complexity of applications that respond to rotation of the iPhone, I was only able to finish chapter 5. To compensate, I completed the equivalent of 8/3 weeks of C lectures at Harvard and was able to review many basic programming concepts as well as to learn new rules and syntax that govern both C and Objective-C. I created 3 example applications from the textbook, but still have a few questions I hope to clear up with the help of Mr. Collias, the programmer who has kindly agreed to help me.
The code in chapter 5 of the textbook is slightly flawed, and so it took me awhile to obtain functioning applications. Instead of wasting setup time that could be better utilized with experimentation, I modified the sample code with concepts from Precalculus and programming themes/syntax from the Harvard video lectures, which may be found at http://cs50.tv/. While there is no modification that is visible superficially, the code itself has been modified. Some changes include using actual radian values rather than a converter from degrees to radians and an elegant select case statement rather than a long series of "else if" statements. The actual application cannot be demonstrated by a picture, so I have included a short video below:



Basically, this application displays two buttons and rotates them when the iPhone is turned. The application accomplishes this through two different views (one for portrait and one for landscape) that are rotated when the iPhone is. If a button is clicked, it is hidden, as is the corresponding button on the other view.

Mr. Collias was sick for the past two days and thus I am not certain if he will be able to meet with me in person tomorrow (2/19/09). However, I discovered that the Beta version of the freely downloadable, cross-platform application supports screen sharing as well as video conferencing. I could use this application to demonstrate code and to ask questions.
Tomorrow I intend to work on chapter 6 and iron out problems from chapter 5 as well as talking to Mr. Collias if possible. I will also continue to view the Harvard lectures online for additional instruction.

1 comment:

  1. A book meant to teach programming should NOT be flawed, no matter how slightly. Kudos for overcoming that obstacle.

    ReplyDelete