Today, we are challenged by Nick Hill to use our mad skilz to make an iPhone calculator.
A view-based application is perfect for this, since we only need one screen.
We’ll use 2 text boxes (inputs), 2 variables, 4 functions, 2 (I used 3) static labels, and 1 dynamic label.
As in (my .h file):
and my .m file:
in my “divide” action, I used the values of the text fields in two ways; as integers and as floats. If I changed the initWithFormat to %f ÷ %f = %f, I got:
UR ANSR = 4.00000 ÷ 1.00000 = 4.00000
Instead, I chose the %i ÷ %i = %f format. Woot woot!
You know I had to add some imagery, so in class I used Adobe Illustrator (can I get a woot woot?) to mask out a LOL cat and stuck ‘im on in there: