Please note, this blog entry is from a previous course. You might want to check out the current one.
Have a row in your main table view called “All” which shows all the photos (not just the photos with a certain tag). Then have the table that appears when you click on “All” be divided into sections by tag (i.e., each section is one of the tags). The simplest way to add the “All” row is to update the information in your database a little bit rather than trying to special-case your table view code (though you will need a special case to turn on sections for that particular table of all photos since you don’t want other tables of photos to have sections). Luckily “All” is alphabetically at the top of the list of types of places, but can you think of a way to modify your schema/fetch criteria to ensure that it is always the top item in the list even if it’s not called “All” or if there were an “Abattoir” tag in the list?
Just add an additional tag for “All” to all photos. To circumvent to “Abattoir” sorting problem, name it so that it will be always be first, e.g.:
#define ALL_TAGS_STRING @"00000" ... + (NSSet *)tagsFromFlickrInfo:(NSDictionary *)photoDictionary inManagedObjectContext:(NSManagedObjectContext *)context { ... tagStrings = [tagStrings arrayByAddingObject:ALL_TAGS_STRING]; ... }
Continue reading “cs193p – Assignment #6 Extra Task #3”