Here is a little application I whipped up tonight for the iPhone. It is based on an assignment from the Stanford course.
Anyway, I call it the "Amazing Polygon App". What it does is calculate the number of degrees, radians, and description of a polygon with a specified number of sides.
There is an increase and decrease button. As you click the buttons the number of sides is incremented (or decremented) and the display is refreshed.
Simple but to the point.




Lessons learned:
- Once you have your initial user interface put together, chances are you'll want to modify it in some ways later. You can easily rearrange the positions of the controls in the Interface Builder.
- To add new controls is not a big problem either. Simply add the controls in Interface Builder. Then in your Controller add instance variables representing the controls and be sure to properly decorate these instance variables with the Cocoa Macros to let the Interface Builder know about them. Once this is done, the instance variables will appear as outlets in the Interface Builder for the controller. Now it is a simple matter to add a connection between the outlet and the control on your user interface!!
No comments:
Post a Comment