iOS Dev – Assignment #1 – Extra Task #1

Adapt the number of shown decimals to the actual result that is to be displayed.

Actually NSNumber does that all. Thus we just have to create an NSNumber from the number before we display it. At the same time we change all floats to doubles to reduce the problem of the “float feature” described before:

- (IBAction)operationButtonPressed:(UIButton *)sender {
    ...
    self.numberTextField.text = [NSString stringWithFormat:@"%@", 
         [NSNumber numberWithDouble:firstOperand]];        
    ...
}

- (IBAction)resultButtonPressed:(id)sender {
    ...
    self.numberTextField.text = [NSString stringWithFormat:@"%@", [NSNumber numberWithDouble:result]];
    ...
}
Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

iOS Dev – Assignment #1

We provide you with a template for a calculator that already adds numbers (at least 1 and 2).
Take a close look at the implementation of this template and write the necessary code to have a fully working calculator.

Let’s have a look at the number buttons:

iOS Dev - Assignment #1 - Number Actions
iOS Dev – Assignment #1 – Number Actions

Continue reading “iOS Dev – Assignment #1”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

iOS Dev – Lectures #1 & #2: Introduction & Objective-C

The first lecture provides an introduction to mobile development on the iOS device family. As assignment it is required to read the iOS Human Interface Guidelines.

The second lecture explains the programming language Objective-C and Memory Management.

The lecture videos and its slices are available on iTunes.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail