Linked Questions
12 questions linked to/from How to define a preprocessor symbol in Xcode
133
votes
4
answers
91k
views
Swift: how to use PREPROCESSOR Flags (like `#if DEBUG`) to implement API keys?
In Objective-C it was sometimes useful to use static string constants to define alternate API keys (for example to differentiate between RELEASE and DEBUG keys for analytics packages, like MixPanel, ...
54
votes
6
answers
55k
views
How can I access a user-defined Xcode build setting?
If I added a user-defined setting in my build configuration, how can I read that setting in my Objective-C code?
I have two files in my project, debug.plist and release.plist. I want my MainApp.m ...
43
votes
2
answers
70k
views
Add preprocessor macro to a target in xcode 6
Probably this is pretty simple, but I can't find a way to define a preprocessor macro for a target in Xcode 6.
22
votes
5
answers
7k
views
Transition an existing paid for app to free version with In App Purchase
I have existing users of a paid for app on the App Store. I'd like to transition the app to a free app with unlock-able features. Is there a way to roll my existing users into this new free version ...
5
votes
3
answers
6k
views
Different code / config in Release & Debug build (Obj-C)
I'm writing a Cocoa app in Objective C that's communicating with a webservice and I want it to connect to a sandbox in debug mode and to the real webservice in release mode. All I need is to change on ...
7
votes
1
answer
8k
views
Conditional compilation in gfortran
I want to know if it is possible to select different parts of my Fortran 95 routine to compile.
For example, if I pass certain flag to gfortran, then the compiler chooses which section to use for a ...
9
votes
1
answer
767
views
Passing preprocessor defines from an XCode5 project to its contained sub-projects
I have a Xcode5 project (A) that is dependent on another XCode5 project (B). Project B is contained as sub-project in Project A. Project B needs to be passed a preprocessor define from project A, but ...
3
votes
1
answer
295
views
How to tell if a C++ symbol is #defined in Xcode
I'm used to Visual C++ which makes it very clear in an #ifdef block if the block is going to be compiled or not.
Does Xcode (3) do this too, I couldn't see how?
1
vote
4
answers
153
views
Application constants used at compilation time
I have many constants in my application used by many classes of my project. These constants have to be set at compilation time (they are not modified later).
For now, I use #define statements at the ...
0
votes
1
answer
512
views
How can PRODUCT_BUNDLE_IDENTIFIER be used as NSErrorDomain for app errors?
How can the product bundle identifier of an OS X app be used for an error domain? Are there any pitfalls of using it so?
It doesn't seem to be defined as a macro; I tried:
NSErrorDomain BSDomain = ...
1
vote
1
answer
300
views
How to create a singleton with #define in XCode4?
I am trying to follow a tutorial for interfacing Game Center, that uses the Apple Documentation and Matt Gallagher's "singleton" document.
However, XCode is emitting polite but vehement protests, ...
0
votes
0
answers
207
views
ncurses doesn't support wide char in Xcode
I'm trying to run this code in Xcode.
I get the error for the following function call mvaddwstr(row, col, shade);
Cannot initialize a parameter of type 'const char *' with an lvalue of type 'const ...