Post

Replies

Boosts

Views

Activity

handling files offloaded to iCloud?
My app saves its document files by default into ~/Documents. It does some important domain-specific stuff when a document is deleted. I monitor for deletion using https://github.com/eonist/FileWatcher Unfortunately several users have noticed my app doing this cleanup work even when they have not deleted the corresponding document. We've traced it through and realised it's the iCloud "Optimise Mac Storage" feature, or "Store in iCloud > Desktop and Documents". I'm not sure which because I don't use these features of macOS at all, and also they seem to have been renamed or changed in Sonoma. Either way, I'm wondering: a) how I can tell in Swift whether a file has actually been deleted, or whether it's been "offloaded" to iCloud by macOS. b) how can I test this? My research is pointing at urlubiquitousitemdownloadingstatus but it's hard to play with it without knowing how to test it.
2
0
363
Sep ’24
NSImages blurred-out in Sonoma
My app uses various PNG images for parts of its UI. In Sonoma these images are rendered all blurred. It looks like I'm putting a 10 or 20px gaussian blur on it, which of course I am not. In prior macOS versions they have rendered just fine. Occasionally some user action in the app will cause a part of one or two images to render sharply, but then it quickly reverts to the blur. I have added the PNGs to the app as image set assets, providing 1x and 2x versions for light and dark modes respectively (so four images each). I'm loading them using NSImage(named: ), and in most cases putting them into an NSImageView. I also use one of them as a patternImage: if let image = NSImage(named: "RackFrame") { let color = NSColor.init(patternImage: image) color.setFill() dirtyRect.fill() } Both methods result in the same issue. Any thoughts on what's going on would be gratefully received!
0
0
747
Sep ’23
How to sign a binary with disable-library-validation entitlement?
I'm trying to sign some PHP binaries so that they are happy to run PHP extensions compiled by other people. I've tried creating a signing-entitlements.plist such as: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.cs.disable-library-validation</key> <true/> </dict> </plist> but when trying to run the following: codesign --entitlements signing-entitlements.plist --force --options runtime --sign '$release_certificate' '$file' ...I get the following error: signing-entitlements.plist: cannot read entitlement data Do I need to convert the XML to some other format perhaps? Is it even the right entitlement to achieve what I am trying to do? Thanks for any help!
2
0
672
Aug ’23
Is applicationShouldTerminate called by the system?
My (Swift) macOS app is periodically & unexpectedly getting applicationShouldTerminate. At a guess it happens once every few days, and the even odder thing is that the app is not quitting in response to this; in my dock it's still showing as running (dot under its icon). When I click its Dock icon, the app goes into applicationDidFinishLaunching and starts up as if it had indeed been quit. The pseudo-termination is happening without any user interaction. Does macOS ever call an application's applicationShouldTerminate, perhaps to free up resources or something? If not, any other ideas regarding what could cause this behaviour?
0
0
508
Oct ’21