You actually get the error message, what is NSManagedObjectContext? NSManagedObjectModel? and NSPersistentStoreCoordinator? do not confirm the BooleanType protocol. Pay attention to ? question mark at the end of the type name.
So you are dealing with Optionals. Because Beta 5 Optionals no longer conforms to the BooleanType protocol.
You need to explicitly specify nil , change:
if !_managedObjectContext {
in
if _managedObjectContext == nil {
And do the same for _managedObjectModel and _persistentStoreCoordinator .
From xCode 6 Beta 5 Release Notes:
Options can now be compared with nil with == and! =, even if the base element is not Equableable.
and
Options no longer conform to the BooleanType (formerly LogicValue) protocol, so they can no longer be used instead of boolean (they must be explicitly mapped to v! = Nil). Does this resolve the confusion around Boul? and the types associated with them, makes the code more explicit about which test is expected, and more consistent with the rest of the language. Note: ImplicitlyUnwrappedOptional still includes some BooleanType features. This issue will be resolved in a future beta.
Keenle
source share