Posts

Showing posts with the label iphone tutorial

[iPhone Tutorial] Create your own iPhone Stopwatch App

Image
Let’s take our existing Clock App we created during our previous tutorials and turn it into a stopwatch. It will look similar to the standard iPhone Clock implementation. Open the ViewController.xib file and move rgw label closer to the top to make a little room for a Start/Stop button at the bottom. Now drag a new button over, change the text to “START”, and size it so it is about the width of the label. Switch to the Sizing inspector and change the Autosizing to stick to the bottom edge of the view. The button and Autosizing should look like Figure A . Figure A Bring up the assistant editor as you did in the previous article so that an action can be added when the button gets tapped. Draw a connection by holding down the control key while dragging from the button to below the label property and release. This time you need to change the connection type to Action, set the name to “onButton” and change the Type to UIButton. Make sure the popup looks like Figure B be...

[iPhone Tutorial] Create your own Apple iPhone Clock App

Image
In this post, we will make an iPhone Clock App which displays the current time on the screen. This is a continuation from our first Hello World App. Open up the previous Hello project and I’ll show you how to get programmatic access to the label so that the text can be modified within our ViewController class. In order to do this you will need to connect the label in interface builder to a property of the ViewController class. Say goodbye Open ViewControler.xib and use the toolbar to show the assistant editor. ( Figure A ) Figure A The secondary editor is displayed next to the ViewController interface and should automatically open the header file for the ViewController class. Hold down the control key and then click and drag from the label to inside the view controller header file as shown in Figure B . Figure B Once the arrow reaches inside the interface definition you can let go to receive an Outlet connection popup. Set the name of the control to “l...