Errata for iOS Apprentice v4.1

Archived errata threads:

Thanks for the great tutorials.

In the MyLocations tutorial on the last page (p.292) the Core Data Programming Guide by Apple is linked. The URL has changed to:

Also the code samples in the guide are now both in Objective-C and Swift. :slight_smile:

Thanks for the head’s up, @linc.

Tutorial 4 “Store Search”, page 125.

Not an error, but rather a change in Xcode (I’m using 7.3.1):

The key in info.plist is now called “App Transport Security Settings”.
And the key in the dictionary is now called “Allow Arbitrary Loads”.

This message was sent to us via our customer support desk:

From: Yuelong Gong
Subject: Code correction

Hi, I’m new in iOS programming, and The iOS Apprentice is a great tutorial for beginners.
But I found a code issue in Checklist Cheaper, page 140 Loading file Part
If the Checklist.plist is exist and not empty, the code always stuck at

checked = aDecoder.decodeBoolForKey(“Checked”)

So I have change the code to

checked = aDecoder.decodeObjectForKey(“Checked”) as! Bool

Only change the code like this, the app can run functional.
My Xcode version is 7.3.1(7D1014), hope my advice will help other beginner solve their same problem.
Thanks

1 Like

tableView(_:indentationLevelForRowAtIndexPath:) in Section 11, iOS Apprentice 2, Checklists, no longer works as ‘var’ parameters have been deprecated. Is there a fix?

You can write var indexPath = indexPath at the top of the method. This makes a new local variable with the same value as the parameter.

Comment submitted by Morgan via our support desk:

Hey there I’m going through the Apprentice 2 Checklist app and I found a small error, page 39 the else if statement for index.row== 3 the pdf has row2checked in the nested if statement and it should be row3checked in that section.

That is an intentional error. :wink: The book actually asks you to find this bug.

1 Like

I noticed on tutorial 1 that the example images have a target score number of 84 but the text says to try to get as close to 22 as possible. I see what the goal is but just wanted to report that. So far looks awesome and easy to retain lessons learned though!

Whoops… I updated the picture but not the text, it seems. Good catch! :smiley:

In iOS Apprentice 2 (5.0), on page 67, it says “3. inserted a new cell for it in the table view.”. Shouldn’t that be “inserted a new row”?

Marcel

as of 2017-10-22 the server archive.raywenderlich.com cannot be found.

Hi, thanks for the heads up. I believe this change was an intentional one that was made several months ago. Were you looking for something specific with those links?

Hello there!
In part Enable the Done button for edits for chapter 14. Edit Items you write to add to implementation of protocol:

Add the following to ChecklistViewController.swift and the compiler error will be history

func addItemViewController(
              _ controller: AddItemViewController, 
     didFinishEditing item: ChecklistItem) {
  if let index = items.index(of: item) {
    let indexPath = IndexPath(row: index, section: 0)
    if let cell = tableView.cellForRow(at: indexPath) {
      configureText(for: cell, with: item)
    }
  }
  navigationController?.popViewController(animated:true)
}

Unfortunately ‘index(of:)’ is deprecated. It’s recommended to use firstIndex(of:) method.

@nosov Thank you for the heads up - much appreciated! We will fix this in the next edition of the book.

Thanks for sharing and this is so helpful for me.

Hi,
iOS Apprentice,

  1. Chapter 2 / “Making the text bolder” part / Note: .semibold is the short version…

Its full name is Font.Weight.bold

should be

Its full name is Font.Weight.semibold

  1. Chapter 2 / The last paragraph

WHile this app responds only to touch

should be

While this app responds only to touch

  1. Chapter 3 / “Adding padding”

The set of edges to pad… .leadingand trailing

should be

The set of edges to pad… .leading and trailing

  1. Chapter 4 / “Simplifying the Alert code”

“ Incorporate the new scoringMessage() method into the alert pop-uo code”

should be

“ Incorporate the new scoringMessage() method into the alert pop-up code”

  1. Chapter 7 / “Introducing ViewModifier”

“Remember the definition for “protocol” from a couple of chapters back…”

but before that there were no mention of “protocols”

  1. Chapter 7 / “Connecting the “Info” button to AboutView”

“.navigationViewStyle(.stack)”

should be

“.navigationViewStyle(StackNavigationViewStyle())”

  1. Chapter 8

“We’ll cakk it from the first Text element…”

should be

“We’ll call it from the first Text element…)”

@omghavefun Thank you for sharing this. I will forward it to the book team and they will definitely fix this in the next release and version of the book.