Assignment #1 Task #5

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add a “C” button that clears everything (for example, the display in your View, the operand stack in your Model, any state you maintain in your Controller, etc.). Make sure 3 7 C 5 results in 5 showing in the display. You will have to add API to your Model to support this feature.

Create a new label above the number display in the storyboard, change the alignment to “right”, remove its text and create a new outlet called “history”. Add a new button called “C” left to the number display and create an action “clearPressed”. Don’t forget to reduce the size of the number display accordingly.
Continue reading “Assignment #1 Task #5”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Assignment #1 Task #4

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add a new text label (UILabel) to your user-interface which shows everything that has been sent to the brain (separated by spaces). For example, if the user has entered 6.3 Enter 5 + 2 *, this new text label would show6.3 5 + 2 *. A good place to put this label is to make it a thin strip above the display text label. Don’t forget to have the C button clear this too. All of the code for this task should be in your Controller (no changes to your Model are required for this one). You do not have to display an unlimited number of operations and operands, just a reasonable amount.

Create a new label above the number display in the storyboard, change the alignment to “right”, remove its text and create a new outlet called “history”.
Continue reading “Assignment #1 Task #4”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Assignment #1 Task #3

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add the following 4 operation buttons:

  • sin : calculates the sine of the top operand on the stack.
  • cos : calculates the cosine of the top operand on the stack.
  • sqrt : calculates the square root of the top operand on the stack.
  • π: calculates (well, conjures up) the value of π. Examples: 3 π * should put three times the value of π into the display on your calculator, so should 3 Enter π *, so should π 3 *. Perhaps unexpectedly, π Enter 3 * + would result in 4 times π being shown. You should understand why this is the case. NOTE: This required task is to add π as an operation (an operation which takes no arguments off of the operand stack), not a new way of entering an operand into the display.

Add four additional buttons called “sin”, “cos”, “sqrt” and “pi” by copying one of the existing operator buttons and adjust the performOperation function in CalculatorBrain.m:
Continue reading “Assignment #1 Task #3”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Assignment #1 Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Your calculator already works with floating point numbers (e.g. if you touch the buttons 3 Enter 4 / it will properly show the resulting value of 0.75), however, there is no way for the user to enter a floating point number. Remedy this. Allow only legal floating point numbers to be entered (e.g. “192.168.0.1” is not a legal floating point number). Don’t worry too much about precision in this assignment.

Add an additional button on the left hand side of the zero button, by copying one of the number buttons. Add a new property userIsInTheMiddleOfEnteringAFloat to CalculatorViewController.m, synthesize it and adjust the digitPressed andenterPressed functions:
Continue reading “Assignment #1 Task #2”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Assignment #1 Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

The first assignment is an extension of the calculator built in lecture #2.

Follow the walk-through instructions (separate document) to build and run the calculator in the iPhone Simulator. Do not proceed to the next steps unless your calculator functions as expected and builds without warnings or errors.

Basically this is solved by code at the end of lecture #2. However, limited time during the lecture prevented the instructor from finishing everything, thus we have to add subtraction and division as operands to CalculatorBrain.m:
Continue reading “Assignment #1 Task #1”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Friday Session #1: Debugging

Please note, this blog entry is from a previous course. You might want to check out the current one.

The individual lectures of the course where held each weak on Monday and Wednesday. On Fridays extra lectures were held about a special topics.

Between lecture #2 and lecture #3 the first Friday session addressed debugging. It can be found on iTunes titled “Debugger (September 30, 2011)”.
Continue reading “Friday Session #1: Debugging”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!

Lecture #2: My First iOS App

Please note, this blog entry is from a previous course. You might want to check out the current one.

The second lecture “2. My First iOS App”, hold on September 29th, 2011, is an one-hour demo about MVC and Objective-C. For maximum experience, it is recommend to enter the given code in parallel to watching the course – and if necessary use the pause function of your viewer extensively. In addition, the slides for this lecture provide a very detailed walkthrough of the demo.

You learn how to create a new project, to navigate in Xcode, to use storyboards, labels and buttons, outlets and actions, strings and arrays, logging and debugging, and how to access the documentation inside Xcode.
Continue reading “Lecture #2: My First iOS App”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Flattr this!