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 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.

iPhone Journal I

Welcome to my iPhone Programming Blog, where I will detail the results of my four week research into the incredible world of iPhone programming.

On Tuesday, 2/17/09, I planned to read "The Objective-C Programming Language" on the Apple Developer website and then to review chapters 1-4 in the textbook I have (Beginning iPhone Development: Exploring the iPhone SDK by Dave Mark and Jeff LaMarche) by creating a sample application. In fact, I read 40 pages of the 105 page programming guide and realized that the remainder of the guide was very technical and unnecessary for basic applications. As I gain more experience, the rest should make more sense to me.
Next, I located a series of introductory C programming videos on the Harvard University website and have found that they are exceptionally effective in demonstrating programming principles. Each day I shall use these as an effective way to gain background information in the C language which forms the basis for Objective-C.
I then decided to create the example application mentioned above. First, I had to reinstall the iPhone SDK because the iPhone was updated since I last wrote an application. Following the directions in the iPhone Developers Portal, I created a new App Id for the applications I will be writing and added this to a new development profile for uploading applications to the iPhone. While reviewing concepts from my textbook, I created a simple application that fills out a "Mad Lib" from the game book "Madagascar Mad Libs: World's Greatest Word Game," by Roger Price and Leonard Stern. This application works very well and is pictured below.
Finally, I decided that the most effective way to create a journal entry would be through a screencast, a video of my computer screen accompanied with audio. After some experimentation, I determined how to accomplish this with my favorite video viewing and capturing application, VLC, along with Audacity, which records audio. Since the video and audio were asynchronous, I needed to combine them with a video editing program. After about an hour of frustration with iMovie '08, one of the worst editing applications in existence (in my opinion), I created an effective screencast. Soon I realized that iMovie '08 had exported a 130 MB movie file and I spent another hour or two before discovering that the application Garageband was capable of exporting a high quality file requiring only 14 MB. I added this file to an email and sent it on its way. About 10 minutes later, I received an email stating that the recipient server had rejected it. As a result, I created this blog capable of storing files up to 100 MB, and processing continued for an hour without any signs of true progress. Now I have made this written journal entry to compensate and am rather irritated.
On Wednesday, 2/18/09, I plan to work on chapters 5-6 of my textbook and maybe chapter 7 depending on how long this takes. I will create another example application and continue to look at online documentation and the Harvard CS Intro tutorials.
~Julian Ceipek