Home > 2010 Winter DPS913 > DPS913 APD601 Lab 4 (due Fri Feb 19)

DPS913 APD601 Lab 4 (due Fri Feb 19)

February 11, 2010 Leave a comment Go to comments

Lab 4 enables you to create a navigation-based application, with multiple levels. It is due on Friday February 19.

.

DPS913 APD601 Lab 4– due Fri Feb 19

Assigned: During Week 5

Due date: Friday, February 19, 2010, at 8:00am

Grade value: 3% of your final course grade

Grading method: The following will be checked:

  • Completeness and adherence to iPhone OS app coding principles
  • Correct interactive operation of the app’s logic
  • Implementation of best practices for nav-based apps

.

Before you begin

Configure your Xcode environment as described in the “Before you begin” section of Lab 1. This will ensure that your work can be uploaded for grading.

.

Objective(s)

Work with a navigation style application.

Create a plist using the Xcode property list editor.

.

Concepts that you will learn

  • Nav app style
  • Configuring view controllers with properties to expose data
  • Modal view controller (for a UIWebView)

.

Introduction to the problem that you will solve

We need an application that will help you plan for the 2010 FIFA World Cup of football.

For information about the World Cup, visit its web site.

You will create an iPhone OS app called “MyWorldCup”. It will enable you to get information about the groups, teams, and matches.

The following images are examples of its user interface (yours may look different):

MyWorldCup Lab 4, showing all eight (8) groups MyWorldCup Lab 4, showing the Group B teams

MyWorldCup Lab 4, showing details for Greece's team MyWorldCup Lab 4, showing the team web site for Greece

.

Specifications

Create a new iPhone OS app, from the “Navigation-based Application” template. Name it “MyWorldCup”. Then, follow the specifications below.

.

Create the data for your app

In its Resources group, create a plist (property list) called “WorldCupTeams.plist”. Use the code editor to hand-enter the data.

The root of the plist will be a dictionary.

Then, you will add eight (8) elements. Each will be a dictionary. The key (name) of each dictionary will match the groups that have been established:

  • Group A
  • Group B
  • …through to…
  • Group H

For each group dictionary, you will add four (4) elements. Each will be a dictionary. The key (name) of each dictionary will match the teams that are in that group. For example, in Group A:

  • South Africa
  • Mexico
  • Uraguay
  • France

For each team dictionary IN GROUP A ONLY, you will add five elements:

  1. String – paragraph of text from “The road to South Africa”, from the Team > Profile section of their web page on the web site
  2. String – Game 1 opponent
  3. String – Game 2 opponent
  4. String – Game 3 opponent
  5. String – URL to the team web site on the 2010 FIFA World Cup web site

(Why only Group A? To save you work.)

See below for a screen capture of the plist structure:

MyWorldCup Lab 4, showing the plist structure

.

The navigation structure

The root table view will display a list of all eight groups.

When the user taps a group in the table view, the next level will show another table view, with a list of teams that are in that group.

When the user taps a team in the table view, the next level will show a standard view, with the following user interface objects (that match up to the data stored in a team dictionary):

  1. UITextView for the paragraph of text from “The road to South Africa”
  2. UILabels or a UITextView that will list the matches the team will play in the group stage
  3. A UIButton (or similar) that will enable the user to show the last level

When the user taps the “Browse team web site” button, the last level will show a standard view, with a UIWebView showing the team’s web site (on the 2010 FIFA World Cup web site).

For guidance on how to complete this lab, read the next section.

.

Lab 4 guidance

There are three topics that are worth discussing:

  1. Optional – sorting the values that you see in a table view
  2. Ensuring that the text view isn’t editable
  3. Ensuring that the web view scales the content to fit the screen

Optional – sorting the values that you see in a table view

When you send the allKeys message to a dictionary, it returns an array of its keys (as strings). However, the array isn’t sorted, and may not even match your data entry order as you created the dictionary.

To sort the array, wrap the message above, and call the NSArray sortedArrayUsingSelector: message. Here’s an illustration of its syntax, assuming that you have an existing “myArray” instance:

[myArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]

(We will cover selectors – @selector – soon. For more information about sorting, see the Collections Programming Topics for Cocoa document.)

Ensuring that the text view isn’t editable

The UITextView has a setting to enable or disable editing. We want to disable editing.

Ensuring that the web view scales the content to fit the screen

The UIWebView has a setting (on its attributes inspector) that enables it to scale the width of the content to fit the iPhone OS device screen. Make sure you set it.

.

Send me your work

Make sure that you have configured your Xcode environment to avoid sending the intermediate build files. This will ensure that your uploads to me are the right size.

Follow these instructions to send me your work:

  1. Make sure your project works correctly
  2. Locate your MyWorldCup project folder in Finder
  3. Right-click the folder, and choose Compress “MyWorldCup”, which creates a zip file
  4. Visit this page: http://matrix.senecac.on.ca/~peter.mcintyre/dps913/, and upload MyWorldCup
.



Advertisements
Categories: 2010 Winter DPS913
  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: