If something is not used in C++, it’s not compiled at all. Is the same true for iPhone?
If I compile a program and there are unused classes or other stuff, will it be compiled or ignored?
If something is not used in C++, it’s not compiled at all. Is the
Share
It depends on your build settings.
Under your target build settings, then under "Linking" there is an option for "Dead Code Stripping". It defaults to yes for projects created with Xcode.
Here’s a link to the build settings documentation from Apple (with an excerpt):
https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html
Note, the docs say the value defaults to NO, but Xcode project settings default the value to YES.