On macOS 26, I've run into a situation when a user “customizes” a folder icon with Finder by assigning/changing an SF Symbol or an emoji, QLThumbnailGenerator keeps returning the stale initially retrieved folder icon (no matter whether it had been customized or not) until my app quits. After the app is re-launched, the icon is correctly retrieved once again.
let generator = QLThumbnailGenerator.shared
let size: CGSize = CGSize(width: 64, height: 64)
let request = QLThumbnailGenerator.Request(fileAt: url, size: size, scale: NSScreen.main!.backingScaleFactor, representationTypes: .icon)
request.iconMode = true
do {
let thumb = try await generator.generateBestRepresentation(for: request)
thumb.nsImage.size = size
return thumb.nsImage
} catch {
print("generateThumbnail: \(error)")
return nil
}
It seems like the QuickLook Thumbnailing cache does not invalidate automatically upon folder customization. Is there any way to manually invalidate the QuickLook Thumbnailing cache?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm having a problem on macOS 26 that has not happened on previous macOS versions. When I call
guard url.startAccessingSecurityScopedResource() else { return }
try url.bookmarkData(options: [.withSecurityScope])
with url being "file:///", I get an error
Error Domain=NSCocoaErrorDomain Code=256 "File descriptor doesn't match the real path."
Given that Google returns 0 results on this error, I suppose this is a macOS 26 novelty. (The bookmark data created before upgrading to 26 resolve well).
Does anyone already met this or have an idea on how to get around it? The app is a file manager, so having bookmarked access to "/" is crucial.