Teaching Announcements
The Welcome View
The Daily Table View
The Module Detail View
The (Modal) Customise View
The aim of the second assignment is to demonstrate an understanding of TableViews (and the drawing of custom cells), Delegates, and the ability to manipulate data structures consisting of both mutable and non-mutable combinations of NSDictionary and NSArray objects, and apply it by creating an iOS iPhone app. The app should be a Timetable application using the iPhone API. Examples of the final version are given below.
Your solution should utilise a variety of different ViewControllers and TableViewControllers to manage the different views, and only use associated .xib files where absolutely necessary (for example, the welcome view, the module detail view, and the custom cells).
Two JSON data sources should be used as part of your solution:
These two resources provide information on the timetable, and basic module details respectively. In addition, the following images may be of use:
•Lecture Image (137-presentation.png)
•Lab Image (174-imac.png)
•Tutorial Image (96-book.png)
•Welcome Background Image (WelcomeBackground.png)
The last image can be (optionally) used as a background to the welcome view. Three of these images have been taken from the royalty free Glyphish set of mobile app icons, which is a good repository for button and tab-bar icons. If you prefer to use your own images, then you can do so.
Finally, make use of the JSON parser (downloadable as a zip file), which was also used as part of the lab sessions.
Detailed Requirements
The full requirements are given (below):
1.The application should start by presenting a “Welcome View” within a UINavigationController, listing the days Monday-Friday. Each day corresponds to one of the arrays of elements within the TimeTable.json file. These can be represented using either a TableView or UIButtons. In addition, in “Information” button should appear, which will take the user to the “Customise” View.
2.When a day is selected, the events for each day should be presented in a UITableViewController managed view (i.e. the “Daily Table View”), which is pushed onto the UINavigationController stack. The events should be formatted to present the module code, module title, module location, and an image to represent whether the event is a lecture, lab or tutorial. Note that this will involve exploiting data from both the TimeTable.json and Semester1Modules.json files.
3.If any of the modules within the “Daily Table View” are selected, then basic information on that module should then be presented by pushing an additional view (the “Module Detail View”) onto the UINavigationView stack, which presents the basic information on the respective module found in the Semester1Modules.json file.
4.It should be possible to determine which modules should appear in the “Daily Table View”. Create a “Customise View” modally, by combining a UITableViewController and a separate UINavigationController, to list the modules found in the Semester1Modules.json file. Present these with the UITableViewCellAccessoryCheckmark to represent the case where a module is selected, and the absence of a check mark should represent where a module is not selected. Ensure that when a table entry is selected, this selection is toggled (i.e. if not selected, it will become selected, and vice versa). Modify the data structures used to present the “Daily Table View” so that only selected modules appear in that view. Note that this view should appear modally, and be dismissed by selecting the Done button.
The work should be based on the material presented in the KingsQueens Lab work (Labs 5, 6 and 7). Additional hints will be given in the lecture material.
You can use any version of Xcode 4 (including the recently released XCode 4.2) running under any version of iOS 5. However, you should not use any of the new features introduced in iOS5, as the code should still run on an iOS 4.3 device. This includes Automatic Reference Counting and Storyboarding.
Marking Scheme
The purpose of this assignment is to demonstrate that you know how to develop native iPhone app using TableViews (and the drawing of custom cells), Delegates, and the ability to manipulate data structures consisting of both mutable and non-mutable combinations of NSDictionary and NSArray. You do not need to hand in any design documentation but your code MUST be well commented so that it explains what is happening in the code. The following marking scheme will be used to assess each submission:
•Navigation and Table Views: (30 marks total)
•Demonstrate an understanding of using a UINavigationView and TableViewControllers, by allowing the user to navigate a day’s events (using a UITableViewController) and find out more details about a selected module (using a UIViewController and associated NIB file), as well as using navigator-generated back buttons. (20 marks)
•Create and utilise custom views for each of the entries in the “Daily Table View” (10 marks)
•Modal View: (30 marks total)
•Create a UITableViewController to present the modules, and provide functionality to allow users to select or deselect modules for later presentation. (10 marks)
•Present and manage the view modally. (20 marks)
•Data Manipulation: (30 marks total)
•Manage the loading of Module data from JSON, and creating structures to support the selection and deselection of modules in the “Customise Modal View”. (10 marks)
•Manipulate a new Timetable data structure to only include modules selected from the “Customise Modal View”, prior to using this new data to drive the presentation of the “Daily Table View” (20 marks)
•General: (10 marks total)
•Layout and Design (10 marks)
Hints
Most of what you need has already been covered in the labs or lecture notes. The following provides a few additional hints for this assignment.
1.Think of each of the views as requiring a separate pair (implementation and header) of files. Ensure that whenever a view is created, properties are use to pass any data it requires.
2.The data from the Semester1Modules.json file consists of a dictionary of modules, where each module also consists of a dictionary of details. You will need to manage this data in two primary ways: The first will involve creating a mutable dictionary, which includes the module details and a “selectable” element that can be changed (you could use a separate data structure, but this could cause problems when synchronising between the selection of cells, and the selected values). Us an NSNumber object (to represent a bool) if you add this “selectable” element to the dictionary - container classes can only contain objects that are derived from NSObject.
3.The second manipulation involves converting the dictionary into an array to drive the Table View Data Source of the “Customise View”. You can create different container objects that share objects (due to the fact that they are retained).
4.in the “Daily Table View”, it is better to create a new data structure that only contains the events corresponding to selected modules, rather than being selective within the TableViewController itself.
5.When manipulating a new data structure containing only selected module entries, make good use of NSLog calls to check the elements you are manipulating. Also, exploit the class factory methods for both dictionaries and arrays, as this avoids getting in a mess with memory allocation. When elements are added to an array or dictionary, they will be retained; therefore you will not need to worry about releasing temporary objects. This task is particularly tricky to do - be warned.
6.Further hints on how to decompose the data sources, and organise your view controllers are available from the presentation given to you during the lectures.
7.The project TimeTableDataHint is available that demonstrates how the JSON data provided by http://www.csc.liv.ac.uk/people/trp/Teaching_Resources/COMP327/TimeTable.json can be parsed. Download this, compile (ignore the warnings) and look at how the code can be used to parse out the NSDictionaries and NSArray structures.
This assignment contributes 15% to your overall mark for COMP327.
The code should compile without warning or errors. In addition, memory should be managed appropriately.
SUBMISSION INSTRUCTIONS
Firstly, check that you have adhered to the following list:
1.Your project should be self contained within a single zip file containing all of the files in the XCode project. The file's name MUST be 'TimeTable.zip'. Ensure that all of your source files are included in the project (hint, unpack it in a different directory and check it still builds).
2.Your project is developed within XCode, not some other language or environment.
3.Your program compiles and runs on a machine within the computer science department’s Mac Lab, either under Xcode 4.2, using the iOS SDK 5 (recently released) or an earlier version. If you have developed your code elsewhere (e.g. your own mac), ensure that it also works on our system before submission. It is your responsibility to check that you can log onto the department’s system well in advance of the submission deadline.
4.Your program does not bear undue resemblance to anybody else's! Electronic checks for code similarity will be performed on all submissions and instances of plagiarism will be severely dealt with. The rules on plagiarism and collusion are explicit: do not copy anything from anyone else’s code, do not let anyone else copy from your code and do not hand in 'jointly developed' solutions.
To submit your solution you must SUBMIT IT ELECTRONICALLY, and adhere to the following instructions:
Electronic submission:
•Your code must be submitted to the departmental electronic submission system at: http://cgi.csc.liv.ac.uk/cgi-bin/submit.pl?module=comp327
•You need to login in to the above system and select ‘Assignment 2’ from the drop-down menu. You then locate the file containing your program that you wish to submit, check the box stating that you have read and understood the university’s policy on plagiarism and collusion, then click the ‘Upload File’ button.
Work will be accepted only if it is submitted electronically following the above instructions.
Finally, please remember that it is always better to hand in an incomplete piece of work, which will result in some marks being awarded, as opposed to handing in nothing, which will guarantee a mark of 0 being awarded. Demonstrators will be on hand during the COMP327 practical sessions to provide assistance, should you need it.
COMP327 - Practical Assignment 2 2011
18/11/2011
Deadline:
3pm Monday 5th Dec ‘11
Example Output