File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Example/NotesExample-macOS Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
3737 logger. append ( " \( try noteBox. all ( ) . readableDescription) \n " )
3838
3939 logger. append ( " Reading notes containing 'writing': " )
40- let allWritingNotes = try noteBox. query { Note . text. contains ( " writing " ) } . build ( ) . all ( )
40+ let allWritingNotes = try noteBox. query {
41+ Note . text. contains ( " writing " )
42+ } . build ( ) . find ( )
4143 logger. append ( " \( allWritingNotes. readableDescription) \n " )
4244
4345 logger. append ( " Reading notes containing 'writing' by Peter Brett: " )
44- let peterBrettsWritingNotes = try noteBox. query { Note . text. contains ( " writing " ) && Note . author. isEqual ( to: peterBrett. id) } . build ( ) . all ( )
46+ let peterBrettsWritingNotes = try noteBox. query {
47+ Note . text. contains ( " writing " ) && Note . author. isEqual ( to: peterBrett. id)
48+ } . build ( ) . find ( )
4549 logger. append ( " \( peterBrettsWritingNotes. readableDescription) \n " )
4650
4751 logger. append ( " Looking into Peter Brett's current object state again ... " )
@@ -53,7 +57,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
5357 }
5458
5559 let viewController = NSApp . mainWindow? . contentViewController
56- logger. display ( viewController: viewController!)
60+ if viewController != nil {
61+ logger. display ( viewController: viewController!)
62+ } else {
63+ logger. append ( " No ViewController!? " ) // fix this
64+ }
5765 print ( logger. string)
5866 }
5967
You can’t perform that action at this time.
0 commit comments