Home > 2011 Winter DPS913 > DPS913 APD601 Lab 4

DPS913 APD601 Lab 4

February 11, 2011 Leave a comment Go to comments

Lab 4 gives you the opportunity to add to an existing navigation-based app, which uses the Core Data framework. You will add three levels of navigation to the app. It is due on Friday, February 18.


DPS913 APD601 Lab 4 – due Fri Feb 18

Assigned: During Week 5

Due date: Friday, February 18, 2011, at 9:50am

Grade value: 3% of your final course grade

Grading method: The following will be checked:

  • Completeness and adherence to iOS app coding principles
  • Correct interactive operation of the app’s logic


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.



Work with a navigation-based style application.

Work with the Core Data object management and persistence framework.

Know how to copy initial data from the bundle to the Documents directory.


Concepts that you will learn

  • Navigation-based app style
  • Core Data stack
  • Configuring view controllers with properties


Introduction to the problem that you will solve

The GRAMMY Awards, for the 2010 calendar year, will be awarded on February 13, 2011.

You will extend an app (“…Grammys…” in the programming examples area), by adding more levels of navigation.

The existing app includes a Core Data model, and a store file. On first launch, code in the app delegate copies the store file, from the app bundle, to the app’s Documents directory.

It also includes a fully-configured root (table) view controller, which displays the award category names.

The app is and will remain read-only. You will not have to create new objects, or modify existing objects.



Download the “…Grammys…” example app from the programming examples download area. You can add to this app, and submit it as your Lab 4.

Study the data model; its entity diagram is shown below:


As noted earlier, the existing app has a fully-configured root (table) view controller, which shows the “cName” attribute of the Category objects.

You will add the following as your Lab 4 work:

  1. Add a table view controller (suggested name is ListAwards); it will display the Awards (“aName” attribute) for a selected Category
  2. Add a table view controller (suggested name is ListNominees); it will display the Nominees (both “Title” and “Artist” attributes) for a selected Award
  3. Add a standard view controller (suggested name is ViewNominee); it will display all the attributes for a selected Nominee


Screen captures from a completed app are shown below. It is a four-screen sequence, from Categories, to Awards, to Nominees, to a specific Nominee.


Lab 4 guidance

When you create the two new table view controllers, do not create a nib – you won’t need one.

When you create the ListNominees table view controller, use the “…Subtitle” cell style, so that you can display both the “Title” and “Artist” attributes.

When you create the ViewNominee standard view controller, make sure that you create a nib for it.


A number of predictable tasks are required when creating another level of navigation in an app that uses Core Data.

Here is an overview/summary of the steps you follow when creating another navigation level that uses a table view controller:

  1. In the .h interface… conform to the NSFetchedResultsControllerDelegate protocol
  2. Add properties for the fetched results controller, and the referring object (i.e. the passed-in managed object)
  3. In the .m implementation… synthesize and memory-manage the properties
  4. Add a fetched results controller (FRC) getter method (you can copy it from the root view controller)
  5. In the FRC method, edit/set the entity, and add a predicate that uses the referring object
  6. In the FRC method, clear the cache before creating the FRC instance
  7. Implement the controllerDidChangeContent: method
  8. Edit the code in the table view data source and delegate methods, so that they use the FRC
  9. In the parent view controller, import the header for the new level of navigation
  10. Implement its tableView:didSelectRowAtIndexPath: method; make sure you set the view title, and pass along the selected (managed) object


Here is an overview/summary of the steps you follow when using a standard view controller.

  1. Do steps 1, 2, and 3 above; you’ll also need IBOutlet properties for user interface (UI) items
  2. Edit the nib (in Interface Builder), and connect the UI items to the outlets
  3. In viewDidLoad:, extract the data from the referring object, and place the data in the user interface
  4. Do steps 9 and 10 above


How will you create the text at the top of the last standard view controller? (In the example above, the text is “GRAMMY 2010 nominee for Song Of The Year in the General category is:”.)

Well, send the referring object the valueForKeyPath: message, and a string that navigates the object hierarchy.


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 Grammys project folder in Finder
  3. Right-click the folder, and choose Compress “Grammys”, which creates a zip file
  4. Visit this page: http://matrix.senecac.on.ca/~peter.mcintyre/dps913/, and upload Grammys


Categories: 2011 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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: