mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-21 08:59:08 +01:00
WIP: segfault
This commit is contained in:
@@ -51,7 +51,7 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
@objc
|
||||
public convenience init(keyPath: KeyPath) {
|
||||
|
||||
self.init(.Attribute(keyPath))
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,9 +67,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `CSSelectTerm` to a `CSSelect` clause for querying the average value of an attribute
|
||||
*/
|
||||
@objc
|
||||
public static func average(keyPath: KeyPath, `as` alias: KeyPath?) -> CSSelectTerm {
|
||||
public static func average(_ keyPath: KeyPath, as alias: KeyPath?) -> CSSelectTerm {
|
||||
|
||||
return self.init(.Average(keyPath, As: alias))
|
||||
return self.init(.average(keyPath, As: alias))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,9 +85,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `SelectTerm` to a `Select` clause for a count query
|
||||
*/
|
||||
@objc
|
||||
public static func count(keyPath: KeyPath, `as` alias: KeyPath?) -> CSSelectTerm {
|
||||
public static func count(_ keyPath: KeyPath, as alias: KeyPath?) -> CSSelectTerm {
|
||||
|
||||
return self.init(.Count(keyPath, As: alias))
|
||||
return self.init(.count(keyPath, As: alias))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,9 +103,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `CSSelectTerm` to a `CSSelect` clause for querying the maximum value for an attribute
|
||||
*/
|
||||
@objc
|
||||
public static func maximum(keyPath: KeyPath, `as` alias: KeyPath?) -> CSSelectTerm {
|
||||
public static func maximum(_ keyPath: KeyPath, as alias: KeyPath?) -> CSSelectTerm {
|
||||
|
||||
return self.init(.Maximum(keyPath, As: alias))
|
||||
return self.init(.maximum(keyPath, As: alias))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,9 +121,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `CSSelectTerm` to a `CSSelect` clause for querying the minimum value for an attribute
|
||||
*/
|
||||
@objc
|
||||
public static func minimum(keyPath: KeyPath, `as` alias: KeyPath?) -> CSSelectTerm {
|
||||
public static func minimum(_ keyPath: KeyPath, as alias: KeyPath?) -> CSSelectTerm {
|
||||
|
||||
return self.init(.Minimum(keyPath, As: alias))
|
||||
return self.init(.minimum(keyPath, As: alias))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,9 +139,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `CSSelectTerm` to a `CSSelect` clause for querying the sum value for an attribute
|
||||
*/
|
||||
@objc
|
||||
public static func sum(keyPath: KeyPath, `as` alias: KeyPath?) -> CSSelectTerm {
|
||||
public static func sum(_ keyPath: KeyPath, as alias: KeyPath?) -> CSSelectTerm {
|
||||
|
||||
return self.init(.Sum(keyPath, As: alias))
|
||||
return self.init(.sum(keyPath, As: alias))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,9 +158,9 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
- returns: a `SelectTerm` to a `Select` clause for querying the sum value for an attribute
|
||||
*/
|
||||
@objc
|
||||
public static func objectIDAs(alias: KeyPath? = nil) -> CSSelectTerm {
|
||||
public static func objectIDAs(_ alias: KeyPath? = nil) -> CSSelectTerm {
|
||||
|
||||
return self.init(.ObjectID(As: alias))
|
||||
return self.init(.objectID(As: alias))
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ public final class CSSelectTerm: NSObject, CoreStoreObjectiveCType {
|
||||
return self.bridgeToSwift.hashValue
|
||||
}
|
||||
|
||||
public override func isEqual(object: AnyObject?) -> Bool {
|
||||
public override func isEqual(_ object: AnyObject?) -> Bool {
|
||||
|
||||
guard let object = object as? CSSelectTerm else {
|
||||
|
||||
@@ -274,7 +274,7 @@ public final class CSSelect: NSObject {
|
||||
*/
|
||||
public convenience init(dateTerm: CSSelectTerm) {
|
||||
|
||||
self.init(Select<NSDate>(dateTerm.bridgeToSwift))
|
||||
self.init(Select<Date>(dateTerm.bridgeToSwift))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public final class CSSelect: NSObject {
|
||||
*/
|
||||
public convenience init(dataTerm: CSSelectTerm) {
|
||||
|
||||
self.init(Select<NSData>(dataTerm.bridgeToSwift))
|
||||
self.init(Select<Data>(dataTerm.bridgeToSwift))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,7 +306,7 @@ public final class CSSelect: NSObject {
|
||||
*/
|
||||
public convenience init(objectIDTerm: ()) {
|
||||
|
||||
self.init(Select<NSManagedObjectID>(.ObjectID()))
|
||||
self.init(Select<NSManagedObjectID>(.objectID()))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,7 +320,7 @@ public final class CSSelect: NSObject {
|
||||
- parameter term: the `CSSelectTerm` specifying the attribute/aggregate value to query
|
||||
- returns: a `CSSelect` clause for querying an entity attribute
|
||||
*/
|
||||
public static func dictionaryForTerm(term: CSSelectTerm) -> CSSelect {
|
||||
public static func dictionaryForTerm(_ term: CSSelectTerm) -> CSSelect {
|
||||
|
||||
return self.init(Select<NSDictionary>(term.bridgeToSwift))
|
||||
}
|
||||
@@ -339,7 +339,7 @@ public final class CSSelect: NSObject {
|
||||
- parameter terms: the `CSSelectTerm`s specifying the attribute/aggregate values to query
|
||||
- returns: a `CSSelect` clause for querying an entity attribute
|
||||
*/
|
||||
public static func dictionaryForTerms(terms: [CSSelectTerm]) -> CSSelect {
|
||||
public static func dictionaryForTerms(_ terms: [CSSelectTerm]) -> CSSelect {
|
||||
|
||||
return self.init(Select<NSDictionary>(terms.map { $0.bridgeToSwift }))
|
||||
}
|
||||
@@ -353,7 +353,7 @@ public final class CSSelect: NSObject {
|
||||
^ self.selectTerms.map { $0.hashValue }.reduce(0, combine: ^)
|
||||
}
|
||||
|
||||
public override func isEqual(object: AnyObject?) -> Bool {
|
||||
public override func isEqual(_ object: AnyObject?) -> Bool {
|
||||
|
||||
guard let object = object as? CSSelect else {
|
||||
|
||||
@@ -381,7 +381,7 @@ public final class CSSelect: NSObject {
|
||||
|
||||
public init<T: SelectResultType>(_ swiftValue: Select<T>) {
|
||||
|
||||
self.attributeType = .UndefinedAttributeType
|
||||
self.attributeType = .undefinedAttributeType
|
||||
self.selectTerms = swiftValue.selectTerms
|
||||
self.bridgeToSwift = swiftValue
|
||||
super.init()
|
||||
|
||||
Reference in New Issue
Block a user