Posts

Post not yet marked as solved
4 Replies
4.7k Views
I have a Build Phase which runs a script. The script is a swift file, which I have simplified to illustrate the crash, like so: #!/usr/bin/env xcrun --sdk macosx swift import Foundation import CryptoKit var sha256 = SHA256() // Do other stuff... All the Xcode 15 betas fail to build my app, instead throwing the error: Command PhaseScriptExecution failed with a nonzero exit code. The logs: JIT session error: Symbols not found: [ _$s9CryptoKit6SHA256VMa, _$s9CryptoKit6SHA256VACycfC ] Failed to materialize symbols: { (main, { _$s20PropertyListModifier6sha2569CryptoKit6SHA256Vvp, _main, __swift_FORCE_LOAD_$_swiftDarwin_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftIOKit_$_PropertyListModifier, ___swift_project_value_buffer, __swift_FORCE_LOAD_$_swiftFoundation_$_PropertyListModifier, ___swift_allocate_value_buffer, __swift_FORCE_LOAD_$_swiftObjectiveC_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftXPC_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftCoreFoundation_$_PropertyListModifier, __swift_FORCE_LOAD_$_swiftDispatch_$_PropertyListModifier }) } Does anyone know of a work-around or solution, or does this just look like nothing more than a bug in the betas, which I should "wait out"? It's had the same problem right from beta 1 to the current beta 5 so it's starting to look like it won't be fixed which is worrying me.
Posted
by Haggis.
Last updated
.
Post not yet marked as solved
2 Replies
655 Views
I want my app to react when it sees that a certain port is being listened to, and likewise when it stops being listened to. Specifically, another app will start a gdb server (at 127.0.0.1 on 9003) and I want mine to detect that. I don't really even care that it's a gdb server, just when the port is in use or not. I can do it right now using polling using a variation of this but that's not great for CPU wakes. I'm wondering if I can use an NWConnection (with no timeout) to monitor for these events (port in use, port no longer in use). If so, any pointers would be very gratefully received :) Even if just to say I'm barking up the wrong tree!
Posted
by Haggis.
Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
I'm using Xcode 12.4 on Catalina (for testing purposes). My app uses some SPM packages (eg Blessed) which specify // swift-tools-version:5.5. Am I correct believing Xcode 12.4 can be made to compile these packages by downloading and installing a later Swift? This is what I've tried: downloaded and installed Swift 5.6.1 from https://www.swift.org/download/ selected the new Swift in Xcode > Toolchains > Swift 5.6.1 confirmed it in Xcode's preferences > Components > Toolchains attempted to resolve my package versions: Xcode File menu > Swift Packages > Resolve Package Versions Unfortunately this results in an error: "Failed to resolve dependencies" "because every version of Blessed contains incompatible tools version and root depends on Blessed 0.3.0..<1.0.0, version solving failed." I'm left wondering, is "Toolchain" something different than "Tools"? My Xcode's "Command Line Tools" is still "Xcode 12.4" (the only option).
Posted
by Haggis.
Last updated
.
Post not yet marked as solved
3 Replies
849 Views
I would like to show a welcome sheet when my app first launches. Starting with a blank Xcode project, I've set up a WelcomeStoryboard how I want it. I can show it as a sheet using a button click, calling this in my ViewController: func showWelcome() { let welcomeStoryboard = NSStoryboard(name: "WelcomeStoryboard", bundle: nil) guard let welcomeViewController = (welcomeStoryboard.instantiateInitialController() as? NSWindowController)?.contentViewController else { return } self.presentAsSheet(welcomeViewController) } However, I am finding it hard to see where I can call that so it will show the sheet when the window first loads. Inside viewDidLoad is too soon, it seems: Assertion failure in -[NSViewControllerSheetTransition animatePresentationOfViewController:fromViewController:], NSViewControllerSheetTransition.m:33 Failed to set (contentViewController) user defined inspected property on (NSWindow): self.fromViewController.view.window should be valid! I noticed that if I wrap presentAsSheet inside DispatchQueue.main.async it works! But I don't understand why that would work, and am reluctant to trust it. I'm hoping someone can shed some light on this for me? It feels like a trivial requirement but I'm stuck on it!
Posted
by Haggis.
Last updated
.
Post not yet marked as solved
1 Replies
1k Views
I want to embed a command line tool into my app. I would like the app to create keychain items, and access those from the tool. Has anyone done this? I've struggled for ages so far with no luck!To test things I have created two test apps, enabled "Keychain sharing" under Signing &amp; Capabilities, and specified the same keychain group in both apps. With this I can access the same keychain items just fine from each app.However, when I embed a test Command Line Tool into one of those two apps, it doesn't seem to inherit the app's "Keychain sharing" setting, and can't access the keychain items created by the parent apps.The code is at https://github.com/jeff-h/sharedKeychainAccessDemo in case anyone's interested.
Posted
by Haggis.
Last updated
.