I’m using testflightapp.com SDK in my project to track crashes during beta test which is conducted on testflightapp.com. I have 2 targets in my Xcode project, which are “ad-hoc” and “app store”.
To initiate testflight SDK, I need to put down a line of code in the AppDelegate.m like:
[TestFlight takeOff:@"67bebb8d8e5396a...A4LjQwNjQ4NA"];
Now, I want the compiler to exclude this line of code when I compile for the target “app store”, because it doesn’t make sense to trigger testflight SDK when it goes to public.
I’m expecting something like #ifdef, but I couldn’t get a clue by searching the forum.
You can use a user-defined build setting that you set in the build settings for each target, and then use an
#ifor#ifdefdirective to test that setting. For example, select your ‘ad-hoc’ target, click on ‘Build Settings’, and scroll down to the ‘User-Defined’ section. Then just click the ‘Add Build Setting’ button and choose ‘Add User-Defined Setting’. You can set different values for your setting for each build configuration (debug, release, etc.).