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