Lecture #14: Core Data Demo

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

Lecture fourteen is named “14. Core Data Demo (November 10, 2011)” and can be found at iTunes. Its slides are available at Stanford.

The theoretical part of this lecture is quite short providing an overview about Core Data thread safety and its usability for table views.

NSManagedObjectContext is not thread safe, thus it can only be accessed in the thread that created it. Because access is usually very fast, using the main thread is mostly file. Another approach is to use
Continue reading “Lecture #14: Core Data Demo”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Lecture #13: Core Data

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

Lecture thirteen is named “13. Core Data (November 8, 2011)” and can be found at iTunes. Its slides are available at Stanford.

This lecture covers Core Data and Documents, NSNotificationCenter and Objective-C Categories.

Core Data in object-oriented API to store data in a database based usually on SQL. Once a visual data mapping is created between database and objects, objects are created and queried using an object-oriented API. The columns in the database table are accessed vie @properties.
Continue reading “Lecture #13: Core Data”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Extra Task #2

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

Allow the user to switch between a normal map view, a satellite map view and a hybrid map view (you’ll likely want to use a UISegmentedControl for this).

During the lazy instantiation of the map view add an additional sub view for a control segment. The control segment is initialized with an array holding the three possible selections. Its position is calculated by using the horizontal center of the map, and subtracting the size of the segment from the height of the map. To enable auto-rotation the the left and right as well as the top margin are set to be flexible (equal to a spring in story board). The “normal” view is set as initial view. When the value of the control segment is changed, the method changeMapType: is called.
Continue reading “Assignment #5 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Extra Task #1

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

Add a photo’s thumbnail image (FlickrFetcherPhotoFormatSquare) to every row in any table view that shows a list of photos. Don’t ask Flickr for the image data of thumbnails that never appear on screen (i.e. fetch thumbnail image data only on demand). There’s no need to cache these images (they are very small). Obviously when a row first appears, it will not have the thumbnail image, but, sometime later, when the thumbnail data comes back from Flickr (and if the row is still on screen), it should appear. Beware Required Task #1. And consider the hint above about not calling UI methods from outside the main thread and also remember that table view cells are reused as the scroll on and off screen.

Basically the procedure is the same as for the annotation views. Check if the table item is photo, download its photo asynchronously and put it on screen back in the main queue. The only difference is that it is necessary to put an placeholder image into the cell otherwise it is not possible to update the image once it has been loaded:
Continue reading “Assignment #5 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Task #8

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

Your must get your application working on a device this week. Obviously we are not going to be able to check this, so it is on you (and the honor code) to check yourself on this required task.

… done. Code from previous tasks works without modification on iPad first Generation iOS 5.1.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail