NSPopover in NSTextView With Links Is Broken: Accessibility Hierarchy Slowdown

Teaser image

Calling NSPopover.show(relativeTo:of:preferredEdge:) with a NSTextView as the positioning view will slow down your app the more links your text view contains. I discovered this with auto-completion popovers in my note-taking app The Archive and hunted down the issue. In notes with ~100 links (hashtags, web links, wiki links, …) displaying the popover with completion candidates was much slower than in short/empty notes. The slowness scales linearly with the amount of links, and is related to accessibility children iteration.

Continue reading …

NSFileWrapper Sometimes Changes Modification Date to the Past

Shiny Frog’s (of Bear.app fame) Matteo Rattoti shared a repository to demonstrate a NSFileWrapper Modification Date Bug:

This repository demonstrates a bug in NSFileWrapper where overwriting a file with the same content using -[NSFileWrapper writeToURL:options:originalContentsURL:error:] sometimes causes the file’s modification date to be set in the past instead of updating to the current time.

It happens about 50% of the time.

Can reproduce on macOS Sonoma.