macos-mojave

Create Spotlight-like window in Swift 4?

 ̄綄美尐妖づ 提交于 2019-12-08 05:26:16
问题 I want to create a window as part of my app which is displaying a Spotlight-like window after hitting a certain keystroke. But all I got is to hide the title : override func viewWillAppear() { self.view.window?.titleVisibility = .hidden self.view.window?.titlebarAppearsTransparent = true self.view.window?.styleMask.insert(.fullSizeContentView) } Which results in: How can I create such a view with Xcode 10 and Swift? 来源: https://stackoverflow.com/questions/54054473/create-spotlight-like-window

Access safari bookmarks in macOS Mojave programmatically

人走茶凉 提交于 2019-12-08 04:12:58
问题 Since upgraded to macOS Mojave, I find there are permission restrictions to user from accessing ~/Library/Safari/Bookmarks.plist . So is there an alternative way to do it programmatically? Is there a SafariKit or something I can use to import bookmarks to my own program? I tried to search online, but no one mentions anything about it. If you guys know, please help me. Thank you 回答1: You cannot access ~/Library/Safari/Bookmarks.plist anymore because of the stricter security rules in Mojave. I

rJava installation fails on macOS 10.14

回眸只為那壹抹淺笑 提交于 2019-12-08 02:38:00
问题 After upgrading to MacOS Mojave (10.14.1), I'm no longer able to install rJava for R version 3.5.1 with Java version "1.8.0_102" installed. I tried the previous solution for MacOS 10.11 but it still did not work, giving this error: Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs

Apache can't load PHP extensions on Mojave

佐手、 提交于 2019-12-07 18:43:22
问题 After upgrade to MacOS Mojave, Apache can't load PHP extensions anymore. Any extension i get the error below on the Apache log ; it seems that Apple implemented Library Validation through Apache on MacOS Mojave. That makes it apparently impossible to load unsigned binaries with Apache. Is there any workaround that would not involve to disable MacOS' SIP ? Failed loading //usr/local/php/extensions/xdebug.so: dlopen(//usr/local/php/extensions/xdebug.so, 9): no suitable image found. Did find: /

MacOS Change menubar Icon using swift 4

五迷三道 提交于 2019-12-07 16:27:14
问题 With the new Dark mode in MacOS Mojave I would like to change the menubar icon of my app. In default, it is a white black bear and rather than just inverting the colors I would like to use an icon of a snoozing bear. I have all my code that sets up the menubar icon in AppDelegate in applicationDidFinishLaunching . So my question is: Is there a way to check if the dark mode was activated and then change the icon using swift 4? I tried: var inDarkMode: Bool { let mode = UserDefaults.standard

Create Spotlight-like window in Swift 4?

假装没事ソ 提交于 2019-12-07 02:06:28
I want to create a window as part of my app which is displaying a Spotlight-like window after hitting a certain keystroke. But all I got is to hide the title : override func viewWillAppear() { self.view.window?.titleVisibility = .hidden self.view.window?.titlebarAppearsTransparent = true self.view.window?.styleMask.insert(.fullSizeContentView) } Which results in: How can I create such a view with Xcode 10 and Swift? 来源: https://stackoverflow.com/questions/54054473/create-spotlight-like-window-in-swift-4

Code::Blocks C++ compiling with MacOS Mojave : fatal error: sys/cdefs.h: No such file or directory

試著忘記壹切 提交于 2019-12-06 11:26:40
(This is my first question ever on StackOverflow) I have to use a Mac at work, and I'm coding in C++ with Code::Blocks (because I am used to this IDE). 2 days ago I upgraded from MacOS High Sierra to MacOS Mojave and I can fairly say that... it was a bad decision. Now, when trying to #include <math.h> I get this error : fatal error: sys/cdefs.h: No such file or directory . I have tried to reinstall the xcode line command tools with xcode-select --install , but it still doesn't work. Does anybody have a clue of what is going on, and how I could solve this issue ? The accepted answer doesn't

gitk fails to launch on macOS 10.14 (Mojave)

删除回忆录丶 提交于 2019-12-06 07:56:43
问题 I get the following error when I try to run gitk on macOS Mojave (10.14.4): Error in startup script: file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef:2: I/O warning : failed to load external entity "file://localhost/System/Library/DTDs/sdef.dtd" <!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> ^ file:///System/Library/PrivateFrameworks/FolderActionsKit.framework/Versions/A/Resources/FolderActions.sdef:2: I/O warning : failed to load external entity

GCP wont work after upgrading to OSX Mojave

扶醉桌前 提交于 2019-12-06 06:35:08
问题 After I upgraded to OSX Mojave (Developer beta 2) I get an error every time I use GCP and also at reinstalling it. ERROR: gcloud failed to load: No module named zlib gcloud_main = _import_gcloud_main() import googlecloudsdk.gcloud_main from googlecloudsdk.calliope import base from googlecloudsdk.calliope import display from googlecloudsdk.calliope import display_taps from googlecloudsdk.core.resource import resource_printer_base from googlecloudsdk.core.resource import resource_projector from

Swift macOS Process.run() port leak

谁都会走 提交于 2019-12-06 06:24:47
问题 Current code: #!/usr/bin/swift import Foundation func runSleepProcess() { let sleepProcess = Process() sleepProcess.executableURL = URL(fileURLWithPath: "/bin/sleep") sleepProcess.arguments = ["0"] try? sleepProcess.run() sleepProcess.waitUntilExit() } while true { runSleepProcess() } Looking in activity monitor, it seems that the mach port usage increases by 1 each loop. Is this expected behavior when running an external process? If not, how do I fix the leak? Thanks. 回答1: It's not expected