removed Median and StandardDeviation from supported aggregates as core data doesn't seem to support them either

This commit is contained in:
John Rommel Estropia
2015-06-06 17:44:04 +09:00
parent b0a637520e
commit c4171de86e
7 changed files with 70 additions and 83 deletions

View File

@@ -32,7 +32,7 @@
</configuration>
<elements>
<element name="Palette" positionX="261" positionY="189" width="128" height="105"/>
<element name="UserAccount" positionX="261" positionY="216" width="128" height="90"/>
<element name="Place" positionX="261" positionY="225" width="128" height="105"/>
<element name="UserAccount" positionX="261" positionY="216" width="128" height="90"/>
</elements>
</model>

View File

@@ -22,13 +22,15 @@ class CustomLoggerViewController: UIViewController, CoreStoreLogger {
CoreStore.logger = DefaultLogger()
}
let dataStack = DataStack()
// MARK: UIViewController
override func viewDidLoad() {
super.viewDidLoad()
self.dataStack.addSQLiteStore("emptyStore.sqlite")
CoreStore.logger = self
}
@@ -52,7 +54,15 @@ class CustomLoggerViewController: UIViewController, CoreStoreLogger {
GCDQueue.Main.async { [weak self] in
self?.textView?.insertText("\(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ [Log] \(message)\n\n")
let levelString: String
switch level {
case .Trace: levelString = "Trace"
case .Notice: levelString = "Notice"
case .Warning: levelString = "Warning"
case .Fatal: levelString = "Fatal"
}
self?.textView?.insertText("\(fileName.stringValue.lastPathComponent):\(lineNumber) \(functionName)\n ↪︎ [Log:\(levelString)] \(message)\n\n")
}
}
@@ -88,21 +98,23 @@ class CustomLoggerViewController: UIViewController, CoreStoreLogger {
switch self.segmentedControl?.selectedSegmentIndex {
case .Some(0):
CoreStore.beginAsynchronous { (transaction) -> Void in
self.dataStack.beginAsynchronous { (transaction) -> Void in
transaction.create(Into(UserAccount))
}
case .Some(1):
CoreStore.addSQLiteStore("dummy.sqlite", configuration: "test1")
CoreStore.addSQLiteStore("dummy.sqlite", configuration: "test2")
self.dataStack.addSQLiteStore("emptyStore.sqlite", configuration: "invalidStore")
case .Some(2):
CoreStore.beginAsynchronous { (transaction) -> Void in
self.dataStack.beginAsynchronous { (transaction) -> Void in
transaction.commit()
transaction.commit()
}
default: return
default:
return
}
}
}

View File

@@ -168,9 +168,16 @@ class StackSetupDemoViewController: UITableViewController {
switch section {
case 0: return "Facebook Accounts"
case 1: return "Twitter Accounts"
default: return nil
case 0:
let count = Static.facebookStack.fetchCount(From(UserAccount)) ?? 0
return "Facebook Accounts (\(count) users)"
case 1:
let count = Static.twitterStack.fetchCount(From(UserAccount)) ?? 0
return "Twitter Accounts (\(count) users)"
default:
return nil
}
}