Assignment #6 Extra Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Allow users to reorder their itinerary for their vacation. To do this, you might want to think about creating a top-level Entity (Itinerary) in your schema and using an “ordered to-many relationship” to store the places in the itinerary. An “ordered to-many relationship” appears in your code as an NSOrderedSet (instead of an NSSet). The table view that shows the places in the itinerary will have to be rewritten to display this NSOrderedSet of places (it won’t be able to be an NSFetchedResultsController-based table view) and you will have to figure out how to use UITableView API to edit an NSMutableOrderedSet. Warning: while this is not that difficult to implement coding- wise, it requires quite a bit of investigation to figure out. Another approach is to add an attribute in your schema that determines the order (but this can be a little bit clunky). The former approach will probably lead to more learning opportunities.

Following the instructions from above create a new Entity called “Itinerary” for the Core Data Model with a ordered one-to-many relationship called “places” on the Itinerary side and “itinerary” on the place side. Recreate all NSManagedObject subclasses and add a category for the Itinerary class.
Continue reading “Assignment #6 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #6 Extra Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add UI to allow the user to add new vacation documents and to pick which vacation they are visiting when they choose the Visit button.

For the first part of this task add a new view controller to both storyboards and setup a new subclass of the UIViewController class. Add a bar button item to the navigation item of the vacations table view controller with a push segue for the iPhone and a popover segue for the iPad from this new button to the new view controller. Add a text field with an outlet and a button with an action to the view controller.

To be able to close the popover controller after the button has been pressed, it is necessary to delegate this to the vacations view controller because it also creates the popover. Thus we add a protocol for the delegate:
Continue reading “Assignment #6 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #6 Task #8

Please note, this blog entry is from a previous course. You might want to check out the current one.

You do not have to get this working on both platforms. Pick whichever of the two you want. It does, however, have to work on a real device, so pick the device you have the hardware for.

The code for the previous tasks has already incorporated both iPhone and iPad. In addition to the simulator the code has been tested on a first generation iPad.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #6 Task #7

Please note, this blog entry is from a previous course. You might want to check out the current one.

To make all this work, of course, you will need to add a Visit/Unvisit button to the scenes in the storyboard which show a photo. If that photo is already in “My Vacation,” then the button’s title should appear as “Unvisit,” otherwise it should appear as “Visit.” Clicking this button toggles whether the photo is part of “My Vacation” or not.

Add a new property which holds the “Visit/Unvisit” button and gets lazy initialized in its getter:

@property (nonatomic, strong) IBOutlet UIBarButtonItem *visitButton;

@synthesize visitButton = _visitButton;

- (UIBarButtonItem *)visitButton
{
    if (!_visitButton) {
        _visitButton = [[UIBarButtonItem alloc] initWithTitle:@"Visit"
                                                        style:UIBarButtonItemStyleBordered 
                                                       target:self 
                                                       action:@selector(visitButtonPressed:)];
    }
    return _visitButton;
}

Continue reading “Assignment #6 Task #7”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #6 Task #6

Please note, this blog entry is from a previous course. You might want to check out the current one.

All of the new tables in this application that show places or photos or tags must be driven by Core Data. It is your responsibility to determine the schema which best supports your needs.

This task is already fulfilled in the other tasks especially task #3 and task #4.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #6 Task #5

Please note, this blog entry is from a previous course. You might want to check out the current one.

You are not required to provide any UI for users to create new Virtual Vacations (see Extra Credit #1 if you want to), so simply create a single Virtual Vacation called “My Vacation” in the user’s Documents directory somewhere in your code. All “visits” and “unvisits” will happen in this “My Vacation” Virtual Vacation. However, just because you do not have to provide UI to create new vacations does not mean you are exempted from any other required tasks which support multiple Virtual Vacations (like Required Task #1). You may well want to create some other Virtual Vacations anyway just to verify that the rest of your code deals properly with multiple of them.

This task is already fulfilled in the other tasks by the functionality of the VacationHelper and tested using the debug database.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail