Errata in iOS Programming, 6th Ed

I am having an issue with chapter-6 page 115. It shows to put the line:

"let segmentControl = UISegmentControl(items: [“Standard”. “Hybrid”, “Satellite”])

Inside the “loadview” function but that gives me an error.

I moved it outside the function and that fixed it but now in chapter-7 it is giving me an error saying "cannot use instance member standardString within property initializers.

Image-1 is the error I get in chapter-6 (could not load this one being new I can only upload one image) and Image-2 is the error I get in chapter-7 after moving the line out of the “loadview” function

image-2

Chapter 22: Core Data > Object Graphs
A minor correction regarding the terminology of Graph Theory. Vertices are the nodes, Edges are the lines which connect them. As such, the final sentence in the first paragraph which reads:

This collection of model objects is often called an object graph, as the objects can be thought of as nodes and the relationships as vertices in a mathematical graph.

should probably instead read:

This collection of model objects is often called an object graph, as the objects can be thought of as nodes and the relationships as edges in a mathematical graph.

or equivalent.

Chapter 10, page 192, I’m getting a SIGABRT error when replacing

let cell = UITableViewCell(style: .value1, reuseIdentifier: “UITableViewCell”)

with

let cell = tableView.dequeueReusableCell(withIdentifier: “UITableViewCell”, for: indexPath)

The program works fine with the former but will crash with a SIGABRT on line 12 of AppDelegate with the latter

Agreed. It would also be cleaner to set the alpha inside animateLabelTransitions:

    func animateLabelTransitions() {
        // Animate the alpha
        self.questionLabel.alpha = 0
        UIView.animate(withDuration: 0.5, animations: {
            self.questionLabel.alpha = 1
        })
    }
1 Like