Updating User Interface Controls

Just like any good programmers we decided to bite this off the same day Apple lifted the NDA even faced with the time constraints. Needless to say the first app will be VERY simple, however it does demonstrate some stuff I stumbled on the first time I started coding against the iPhone SDK. 

The app is "Minutes to Midnight"  it is simply a countdown of the time left I have to finish this app before tomorrow :).  This idea came from my friend Chris Craft who committed (and completed!) 30 day of Windows Mobile development.

To get started fire up xCode and

From the "New Project" dialog

This project already has a UIView we that will be the main view of or application.  I imagine a count down looking like a plastic alarm clock which of cource counts backwards to zero.  Let make our text have a red LED look and our back ground black.

First lets open our UIView interface and give it a black background

Now lets add a UILabel that will be the display for our countdown.

We need to reference the label in our code so we can update the label

Now we need to update our class file

Now we need to wire up the Label in Interface Builder to the UILabel in the class file

Return to xCode and rebuild the project

Okay getting closer,  we need to do the following to finish up.

Start Timer
        -(void)updateLabel {
        } 
        right before the line @end

Update the label


Now just build and run in the simulator.
        

  


Download Source Code:  MinutesToMidnight.zip