SICT

DPS923 & MAP523

Mobile App Development for iOS

Notes Topics Weekly Resources Graded work Professor Code examples

DPS923 MAP523 Week 10 Notes

Thursday, March 12 - classroom lecture

More work with Core Data this week. And, a brief introduction to location services.


Thursday plan

Thursday, March 12

We will cover these - discuss, show-and-tell, diagram, etc. - in the Thursday class. While some brief notes are included below, be prepared to take your own notes.

Multi-entity data model notes.

Table view editing notes.

Location services introduction

A reminder to learn via the code examples.


Code examples

The course’s GitHub repo has code examples for many topics and techniques. You can download a zip of the code repo, or clone it.


Summary

Here’s a list of topics that we learned something about this week:

  1. Our first exposure to a multi-entity data model was the ...Canada code example. It had a Province one-to-many relationship with City.
  2. We know that the Core Data model editor generates a class for each defined entity. The class includes properties for each attribute, and a method to make a fetch request.
  3. The model editor is also used to define relationships among entities. Most typical of our work is one-to-many. Both ends must be carefully configured.
  4. The generated class for a related entity includes methods to add and remove items.
  5. When working with an entity object that has a collection of related objects of another entity, we must be careful to think about the delete handling. Common sense and the app’s purpose will inform that configuration task.
  6. In the ...Canada code example, each “list” view controller had its own fetched results controller (frc).
  7. There is another way of passing on results - just pass on the property value of the collection.
  8. The data type of the collection is Set, which is not an array. It can, however, easily be transformed into an array.
  9. Which way you choose will depend on your needs and preferences, and the logic at the time.
  10. Returning to the fetched results controller (frc) topic, the frc will “monitor… and report on… changes… [to] update the user interface”. Implementing that should be done by using the code in the project template.
  11. Core Location is the technology that enables a developer to use geographic location data in an app.
  12. There are many parts to an that uses location services, but its core or base part is the CLLocationManager object. That knows how to use the device’s locators, and report the results.
  13. Using location is a privacy-sensitive task, so the developer must ask the user for consent.
  14. The location data gathering task is highly configurable, with regard to frequency, accuracy, and so on.
  15. There is a standard approach to getting location data, which must be used.
  16. In addition, the hosting controller must conform to the CLLocationManagerDelegate, so that events that arise can be handled.
  17. Reverse geocoding is the name given to the task of converting a GPS coordinate into a street address.
  18. You should be able to learn at least five new coding tasks and strategies by studying the code examples.