Errata for iOS Apprentice v4.1

This topic is for bugs, typos, and other mistakes in iOS Apprentice v4.1.

2 Likes

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ā€