Page 501(paper) 183(pdf)

Instead of looking into the locations array like you did before, you now ask the
fetchedResultsController for the object at the requested index-path. Because it is
designed to work closely together with table views, NSFetchedResultsController
knows how to deal with index-paths, so that’s very convenient.
➤ Make the same change in prepare(for:sender:).

//What is the author talking about?
I’m new to programming and I don’t understand what he’s referring to.

the author wants you to switch your prepare(for segue:) to set location to the fetchedResultsController

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

if let indexPath = tableView.indexPath(for: sender as! UITableViewCell) {
let location = fetchedResultsController.object(at: indexPath)
controller.locationToEdit = location

If you’ve followed the tutorials up to this point, you should know what I’m referring to since you’ve done similar things before in the previous tutorials. :wink:

Sorry, I’m having enough trouble just following the book without breaking the app.

Sorry, my reply may have sounded harsher than I intended. (Sometimes people skip whole parts of the book and then complain that they don’t understand something.)

I assume that you followed tutorial 1 and 2 first. Did you understand everything from those tutorials? If not, it’s a good idea to go over them again to improve your understanding first, since tutorial 3 builds on 1 and 2.

If you have any specific questions about things that are unclear, then by all means keep asking them in these forums, that’s what they are here for. :slight_smile:

Thank you. I’m a non programmer newbie.

I’ve followed from the beginning. During the “My Locations” work, I seem to get errors almost every time I enter a new block of code. And I’m also confused by xCode’s interface not matching what’s described in the book.
Should I be getting errors almost every time I type in new code?

Xcode will give errors while you are typing, since it tries to compile the code as you’re still typing it. Since the code is incomplete while you’re typing, Xcode will show errors or warnings but they are only temporary.

If the errors won’t go away, and what you see in the book is not what you see in Xcode, then maybe you’re using an older version of the book and a newer version of Xcode. The current paper version is for Xcode 7, while the current PDF version is for Xcode 8. There are several big differences between Xcode 7 and 8, and also between the versions of Swift used in the 4th and 5th editions of the book.

It’s unfortunate but Apple changes around everything every year and so teaching materials from the previous year go out of date quickly. If you also have the PDF and want to use Xcode 8 and Swift 3, then download the latest version. If you want to keep working from the paper book, you’ll have to downgrade to Xcode 7 (you can still download this from the Apple developer portal).

Let me know if there’s anything else we can help with. :smile:

Every time I get to a point to where something new does work, I zip up the project files and then proceed with caution. I know how hard it is to write anything instructional that involves computers. I used to write developer documentation for an old place called Bell Laboratories.
I’m using Version 8.2.1 (8C1002) and reading from the PDFs.