cs193p – Assignment #6 Task #3

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

Add a thumbnail image (FlickrFetcherPhotoFormatSquare) of each spot to every row in any table view that shows a list of spots. In addition …
a. Don’t ask Flickr for the image data of thumbnails that never appear on screen (i.e. fetch thumbnail image data only on demand).
b. Don’t block your main thread waiting for Flickr to give you a thumbnail’s data.
c. Never ask Flickr for the same thumbnail twice (cache the thumbnails’ data in your Core Data database).

To be able to display the thumbnail, we need its URL, which is currently missing in the core data 🙁 … add a new string attribute to the Photo entity, recreate its NSManagedObject subclass and set it in its category:

+ (Photo *)photoWithFlickrInfo:(NSDictionary *)photoDictionary
        inManagedObjectContext:(NSManagedObjectContext *)context
{
        ...
        photo.thumbnailURL = [[FlickrFetcher urlForPhoto:photoDictionary
                                                  format:FlickrPhotoFormatSquare] absoluteString];
        ...
}

Continue reading “cs193p – Assignment #6 Task #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #6 Task #2 Part #3

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

Recreate the user-interface from last week’s assignment but rely entirely on the above-mentioned Core Data database to present it.

Copy the files for the last table view controller into the current project. Adjust it to setup the fetched results controller every time the view appears:

- (void)viewWillAppear:(BOOL)animated
{
    ...
    [self.sh useDocumentWithOperation:^(BOOL success) {
        [self setupFetchedResultsController];
    }];
}

Continue reading “cs193p – Assignment #6 Task #2 Part #3”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #6 Task #2 Part #2

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

Recreate the user-interface from last week’s assignment but rely entirely on the above-mentioned Core Data database to present it.

Copy the files for the second table-view controller from the previous project together with the image-view controller and the flicker cache class into the current project.

Change the table view controller to be a subclass of the core-data-table-view controller, and change the public property to be a Tag entity.

@interface FlickrPhotoTVC : CoreDataTableViewController
@property (nonatomic, strong) Tag *tag;

Continue reading “cs193p – Assignment #6 Task #2 Part #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #6 Task #2 Part #1

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

Recreate the user-interface from last week’s assignment but rely entirely on the above-mentioned Core Data database to present it.

Start by copying the content of story board for the iPhone of the previous SPoT project into the current project. Copy the class files for the first table-view controller of the first tab of the previous project together with the files for the network-activity indicator into the current project as well as the core-data-table-view controller from the demo of the lecture.

Define the table view controller as sub class of the ore-data-table-view controller:

@interface FlickrPhotoTagTVC : CoreDataTableViewController

Continue reading “cs193p – Assignment #6 Task #2 Part #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #6 Task #1

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

Create a Core Data-managed object database model in Xcode suitable for storing any information you queried from Flickr in the last assignment that you feel you will need to perform the rest of the Required Tasks in this assignment. Take the time to give some thought to what Entities, Attributes and Relationships your database will need before you dive in.

Following the recommendations of the assignment create a new blank universal single-view project. Create a new data model. Start by adding two new Entities “Photo” and “Tag” to hold the photos and its tags. Add a many-to-many relationship between them, because a photo can have multiple tags and a tag can have multiple photos.

The first table view should show the name of the tag and the number of photos it is associated with. Create a new string attribute for the tag entity to hold the name. The number of photos will be derived using its relationship to the photo tags.
Continue reading “cs193p – Assignment #6 Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #14 – Photomania Demo

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

Lecture #14 provides an extensive demo of Core Data.

The code of the demo is available at Stanford and on github.

Slides are available on iTunes …..

The lecture is available at iTunes and is named “14. Photomania Demo (February 21, 2013)”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #13 – Core Data Continued

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

Lecture #13 continues with Core Data, shows how to use categories to “enhance” managed objects, and explains how to use Core Data as source for table views.

Slides are available on iTunes …..

The lecture is available at iTunes and is named “13. Core Data Continued (February 19, 2013)”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail