> On Mar 20, 2022, at 9:09 AM, Gabriel Zachmann <z...@cs.uni-bremen.de> wrote: > > I have now the crash report. > > Apparently, this caused it: > > Symbol not found: _AVAudioSessionInterruptionNotification > > Yes, I am using that function, and yes, it seems to be available only on > macOS 11 and higher. > > My question now is: why did Xcode not warn me about that function, even > though the deployment target was set to 10.12 ? The deployment target not a compiler setting. It is more of a runtime thing. So if you set the deployment target to 13.0 it will not launch on macOS 12, for example. The SDK is what determines what API are (not) available. So if you were building against the 10.12 SDK you would have gotten a compiler error.
> How can I prevent things like that happening in the future? Use the correct SDK for the OS builds you want to support. There are macros you can use to block off areas of code that require specific OS versions. For example: #include <Availability.h> #if defined(__MAC_10_12) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_12 // code that requires the 10.12 or later SDK #endif —Rob _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com