DPS923 MAP523 Quiz 2

Quiz 2, on Tuesday, January 27, 2015

.

The sample answers are just that – sample answers. It is not necessary to include all items in a sample answer in order to earn partial or full credit.

.

In iOS programming, what is a delegate? Briefly describe its purpose and usefulness. (1 mark)

An object that performs tasks for another object.

Programming technique that implements ‘loose coupling’.

Or, if another object cannot be modified, or is not designed to be modified, it’s a way to define behaviour when events happen.

.

Briefly describe the purpose and usefulness of a model class in an iOS app. (1 mark)

Implements the app’s data model.

Central place to manage and maintain the app’s data.

Provides properties (data state) and functions (state modification).

.

At runtime, briefly describe how a picker view is built and rendered. (1 mark)

Picker view needs a data source, typically an array.

Also needs a delegate.

The Cocoa runtime first asks about the dimensions of the picker view:

  • how many rows,
  • how many components per row

Then, for each ‘cell’, the runtime asks for the cell contents.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: