small medium large xlarge

Generic-user-small
21 Aug 2016, 16:31
Patrick Gili (1 post)

I am reading the section named “Introducing the UIManagedDocument” (in Chapter 9, “Using Core Data with iCloud”).

I became rather confused starting with the paragraph that starts, “The second URL–the iCloud URL–is a bit different.” Following the example, the method initializeCoreDataStack() has no call to fileManager.URLForUbiquityContainerIdentifier().

After perusing PPRDataController.swift, I found a method called initializeCoreDataStack2(), which does call fileManager.URLForUbiquityContainerIdentifer(). However, the initializer for PPRDataController does not call initializeCoreDataStack2().

Is this a bug? Or, I am misunderstanding the code?

Cheers, Patrick

Avatarsmall_pragsmall
01 Sep 2016, 17:33
Marcus S. Zarra (273 posts)

Neither :)

The code in the book is generated from the source code directly. The source code is used in a few chapters and at times will have two methods that evolve in the book. Instead of creating multiple identical projects with a couple of methods different I created v2 methods in the existing projects and linked to those.

That is where the confusion is coming from :)

initializeCoreDataStack2() is the method you should be looking at in this case.

You must be logged in to comment