Tuesday, January 19, 2021

NSSavePanel Crashes on Big Sur

Christian Tietze:

By now, I expected NSSavePanel.allowedContentTypes to work, and then to have Xcode suggest to wrap access to that property in an if-@available block. But that doesn’t work at all. With macOS 10.15 Catalina being my main dev machine, I cannot use the new API at all at the moment, it seems, no matter what I set the deployment target to.

[…]

It actually turns out that public.csv is not a built-in file type recognized by macOS. The archived docs for UTIs list many UTIs, but not CSV.

So make sure to check your assumptions when you write apps that export data without actually registering the exported file type UTIs!

2 Comments RSS · Twitter

It's "public.comma-separated-values-text", a.k.a. the constant kUTTypeCommaSeparatedText.

Isn't the point of public.* that only Apple should maintain that? But, yeah, surely the process shouldn't outright crash upon encountering an unexpected type.

Leave a Comment