Post

Replies

Boosts

Views

Activity

ScreenSaver caching during development on Sonoma
Hi all, I've been playing around with making a screen saver using ScreenSaver.framework and having issues with (what appears to be) macOS caching the previous version of the screensaver until I reboot. I have written a screen saver that works, however if I make some changes to the code, re-archive and reinstall the newly compiled screen saver still presents the old screen saver. I've tried incrementing the build number to no avail. Does anyone have a solution to this? My workflow :- Uninstall and delete all instances of my screen saver. Reboot Open Xcode, compile, re-archive my screen saver. Double-click the archived screen-saver, click to install for this user. Test screensaver -- success! Now, Delete the screensaver by right-click on screensaver in System Settings, "Delete " Make changes to my code, rearchive. Double-click the archived screen-saver, click to install for this user. Test screensaver -- fail! Still shows the old version of the screensaver. Reboot machine Test screensaver -- success! Screensaver now shows the changes I made. Many thanks all.
1
0
861
Jan ’24
[macOS] CoreSpotlight importer using CSImportExtension failing to index
I've been trying to add a CoreSpotlight indexer to my macOS application. The new template for the indexer uses the new appex CSImportExtension style importer. I've been following this -> https://developer.apple.com/documentation/corespotlight/csimportextension I changed the CSSupportedContentTypes in the Info.plist file to the correct file type uti. I added a dummy value into the attributes (see code below) - just setting contentDescription to 'noodle' (easy to search for) class ImportExtension: CSImportExtension {   override func update(_ attributes: CSSearchableItemAttributeSet, forFileAt: URL) throws {     // Add a dummy value, and see whether spotlight finds it     attributes.contentDescription = "noodle" } } I have a number of files on disk that match the uti (and can be found when I search by the file name) Yet, when I build and run my app, the a spotlight search for 'noodle' finds no results. Can anyone give me any advice? I cannot find any indication that the ImportExtension is called (although when I put a log message at the start of the update() call there's no message in the console which seems to suggest it's not being called). Is there any way of debugging this? Cheers and thanks -- Darren.
5
0
1.7k
Sep ’22
"JIT session error: Symbols not found" when running swift command-line tool
Hi all, I have a swift script that I've been running from the command line (macOS 12.4, Xcode 13.4.1) for a while with no issues. I recently downloaded Xcode 14 beta 3 and the script no longer runs. It now fails with a "JIT session error: Symbols not found" error. I can cut the script down to a very simple example #!/usr/bin/swift import Foundation var url: URL = URL(fileURLWithPath: "/tmp") I need to import Foundation to get access to the URL type for my script. Xcode 13.4.1 doesn't seem to need to do anything clever % swift commandline-fail.swift JIT session error: Symbols not found: [ _$s10Foundation3URLV15fileURLWithPathACSSh_tcfC, _$s10Foundation3URLVMa ] Failed to materialize symbols: { (main, { __swift_FORCE_LOAD_$_swiftCoreFoundation_$_main, __swift_FORCE_LOAD_$_swiftDispatch_$_main, _$s4main3url10Foundation3URLVvp, __swift_FORCE_LOAD_$_swiftObjectiveC_$_main, __swift_FORCE_LOAD_$_swiftDarwin_$_main, _main, __swift_FORCE_LOAD_$_swiftXPC_$_main, __swift_FORCE_LOAD_$_swiftIOKit_$_main, ___swift_project_value_buffer, ___swift_allocate_value_buffer }) } The failing swift version is % swift --version swift-driver version: 1.60 Apple Swift version 5.7 (swiftlang-5.7.0.120.1 clang-1400.0.28.1) Target: x86_64-apple-macosx12.0 This script runs fine using % swift --version swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12) Target: x86_64-apple-macosx12.0 Does anyone have any ideas how I can solve this issue? It looks like the JIT needs access to the Foundation library but I have no idea how to do this. Cheers!
5
0
4k
Jul ’22
SwiftUI ColorPicker onAppear/onDisappear
Hi all, Is there a way to be notified when the SwiftUI ColorPicker presents and/or dismisses its popover? The standard .onAppear() and .onDisappear() on the ColorPicker() get called when the BUTTON for the colorpicker is presented, rather than when the popover is presented. ColorPicker("Mine", selection: $colorValue) .onAppear(perform: { // Do something when the popover is presented }) .onDisappear(perform: { // Do something when the popover is dismissed }) The .onAppear() and .onDisappear() in this code get called when the ColorPicker BUTTON appears, which is not what I'm wanting. I'm using the .onAppear() and .onDisappear() with the standard .popover(isPresented: ...) view modifier to begin/end undo grouping elsewhere in my View which works well. Button(...) .popover(isPresented: $showWidthSlider) { HStack(spacing: 0) { ... } .onAppear(perform: { self.model.beginUndoGrouping() }) .onDisappear(perform: { self.model.endUndoGrouping() }) I'm relatively new to SwiftUI so I'm hoping I'm just missing something obvious. Cheers!
0
0
841
Oct ’21