NSSavePanel: „[NSPathStore2 stringByAppendingPathExtension:]: nil argument“

Hey,

I‘m building a proven document-based app with Xcode 15 / macOS 14 SDK with a deployment target of macOS 10.13. After some adjustment due to unclipped views and state restoration, everything works fine under Sonoma.

But on older systems (e.g. macOS 10.14) invoking an NSSavePanel directly throws an exception:

1: "*** -[NSPathStore2 stringByAppendingPathExtension:]: nil argument

I‘m not explicitly fiddling with the path extension, and the code works - as mentioned - under some (old and new) macOS versions. The macOS 15 AppKit release notes are listing some changes to NSSavePanel, maybe the issue is related…

Has anyone made similar observations - and knows a potential fix?

Greetings, Mattes

Answered by MyMattes in 770009022

My mistake - I hadn't covered an edge case well (NSString operations with paths). Problem solved.

Accepted Answer

My mistake - I hadn't covered an edge case well (NSString operations with paths). Problem solved.

NSSavePanel: „[NSPathStore2 stringByAppendingPathExtension:]: nil argument“
 
 
Q