mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 13:13:33 +01:00
XCode7 beta 6 updates
This commit is contained in:
@@ -80,12 +80,10 @@ public extension BaseDataTransaction {
|
||||
var existingObjects = [T]()
|
||||
for object in objects {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.context.existingObjectWithID(object.objectID)) as? T {
|
||||
|
||||
let existingObject = try self.context.existingObjectWithID(object.objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
@@ -101,12 +99,10 @@ public extension BaseDataTransaction {
|
||||
var existingObjects = [T]()
|
||||
for objectID in objectIDs {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.context.existingObjectWithID(objectID)) as? T {
|
||||
|
||||
let existingObject = try self.context.existingObjectWithID(objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
|
||||
@@ -81,12 +81,10 @@ public extension DataStack {
|
||||
var existingObjects = [T]()
|
||||
for object in objects {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.mainContext.existingObjectWithID(object.objectID)) as? T {
|
||||
|
||||
let existingObject = try self.mainContext.existingObjectWithID(object.objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
@@ -102,12 +100,10 @@ public extension DataStack {
|
||||
var existingObjects = [T]()
|
||||
for objectID in objectIDs {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.mainContext.existingObjectWithID(objectID)) as? T {
|
||||
|
||||
let existingObject = try self.mainContext.existingObjectWithID(objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, mapping.keys.array)) ?? [] {
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, Array(mapping.keys))) ?? [] {
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
@@ -261,7 +261,7 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
|
||||
var objects = Dictionary<T.UniqueIDType, T>()
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, mapping.keys.array)) ?? [] {
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, Array(mapping.keys))) ?? [] {
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ public extension DataStack {
|
||||
|
||||
let migrationOperation = NSBlockOperation()
|
||||
migrationOperation.qualityOfService = .Utility
|
||||
operations.map { migrationOperation.addDependency($0) }
|
||||
operations.forEach { migrationOperation.addDependency($0) }
|
||||
migrationOperation.addExecutionBlock { () -> Void in
|
||||
|
||||
GCDQueue.Main.async {
|
||||
|
||||
@@ -237,9 +237,9 @@ extension MigrationChain: CustomDebugStringConvertible {
|
||||
steps.append(nextVersion)
|
||||
version = nextVersion
|
||||
}
|
||||
paths.append(" → ".join(steps))
|
||||
paths.append(steps.joinWithSeparator(" → "))
|
||||
}
|
||||
|
||||
return "[" + "], [".join(paths) + "]"
|
||||
return "[" + paths.joinWithSeparator("], [") + "]"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ class MigrationsDemoViewController: UIViewController {
|
||||
}
|
||||
|
||||
self.titleLabel?.text = organismType
|
||||
self.organismLabel?.text = "\n".join(lines)
|
||||
self.organismLabel?.text = lines.joinWithSeparator("\n")
|
||||
self.progressView?.progress = 0
|
||||
|
||||
self.headerContainer?.setNeedsLayout()
|
||||
|
||||
@@ -377,8 +377,9 @@ class CoreStoreTests: XCTestCase {
|
||||
|
||||
do {
|
||||
|
||||
try NSFileManager.defaultManager().removeItemAtURL(
|
||||
NSFileManager.defaultManager().URLsForDirectory(.ApplicationSupportDirectory, inDomains: .UserDomainMask).first!
|
||||
let fileManager = NSFileManager.defaultManager()
|
||||
try fileManager.removeItemAtURL(
|
||||
fileManager.URLsForDirectory(.ApplicationSupportDirectory, inDomains: .UserDomainMask).first!
|
||||
)
|
||||
}
|
||||
catch _ { }
|
||||
|
||||
Reference in New Issue
Block a user