Post

Replies

Boosts

Views

Activity

Reply to Change in iOS 14 Beta 3 to trigger 0xdead10cc
In my own experiences with two projects, either building from Xcode 11.6 or Xcode 12 beta 3, the issue of Realm lock file in shared group did exist on real devices. If you use the simulator, everything is fine. Realm 5.3.2. There is an issue on realm too. But it seams people believe it is Apple who to blame. https://github.com/realm/realm-cocoa/issues/6671
Jul ’20
Reply to Debugging Siri Shortcut on simulator
So far, for Xcode 11 and after. The best way to test Shortcuts is using: for Xcode 11.x with macOS 10.15.x, downloading in Xcode with 11.3 simulators. This is the best choice. for Xcode 12 betas with macOS 11 betas, just use the latest simulator with Xcode 12. This is the second choice, as some APIs don't work in localization, but works in English. The issue also exists in iOS 14 betas real devices.(My bug issue id: FB8550556, Siri doesn't use Localized String in some API. "INIntentResolutionResult.success((with resolvedString: String) -> Self".) Others: simulator 11.3 doesn't work in macOS 11, either with Xcode 11 or Xcode 12.
Sep ’20
Reply to Using Variable in Action Extension doesn't Work
A further investigation had shown that the issue was happened here. arguments.completionFunction({ keyword : document.getElementsByClassName(keyword)[0].innerHTML }) There were two keywords used. arguments.completionFunction({ keyword : document.getElementsByClassName(keyword)[0].innerHTML }). The issue was on the first keyword. It didn't convert to its value "link" but used its variable name "keyword" as the key. Maybe I should file a bug for this? UPDATES Just found this. https://stackoverflow.com/questions/10640159/key-for-javascript-dictionary-is-not-stored-as-value-but-as-variable-name In fact, this was a well-known issue of how javascript interprets. The code should changed to arguments.completionFunction({ [keyword] : document.getElementsByClassName(keyword)[0].innerHTML }) Just using [] around keyword in key part. I am not familiar with Javascript. But now I hate it. :( Problem Solved!
Sep ’20
Reply to SFSafariToolbarItem can't be localizable
I didn't find a solution to localized that value either. However, we could change the label value in code. override func validateToolbarItem(in window: SFSafariWindow, validationHandler: @escaping ((Bool, String) -> Void)) { 		// This is called when Safari's state changed in some way that would require the extension's toolbar item to be validated again. 		window.getToolbarItem { (toolbarItem) in 				toolbarItem?.setImage(NSImage(named: "MonochromeIcon")) 				toolbarItem?.setLabel(NSLocalizedString("Open URL in Page By Poster 2", comment: "")) 		} 		 		validationHandler(true, "") } Then you can localized the text what you want.
Sep ’20
Reply to Window NSWindow 0x137632e40 ordered front from a non-active application and may order beneath the active application's windows
This is not a meaningless issue. This will cause unexpected behavior like error alert doesn't show in SwiftUI. If you encounter the same like me. You can get the window and make it key and front to fix this issue. I used https://github.com/happycodelucky/SwiftUIWindowBinder to get the NSWindow. And used below func to make it key and front. var body: some View { WindowBinder(window: $window) { // content view } .onAppear { makeKeyAndFront() } } private func makeKeyAndFront() { if let window { window.makeKeyAndOrderFront(nil) } else { DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { makeKeyAndFront() } } }
Jul ’23