2

I want to set the DEBUG value to 1 or 0 from code. After specific event answer and not from other C Flags?

#if DEBUG==1
#define DBLog(format, ...) NSLog(@"%s:%@", __PRETTY_FUNCTION__,[NSString stringWithFormat:format, ## __VA_ARGS__]);
#define MARK    DBLog(@"%s", __PRETTY_FUNCTION__);

#else
#define DBLog(format, ...)
#define MARK

#endif 
0

1 Answer 1

1

The preprocessor directives are used in a phase before compiling your code, so you can't choose one of those branches during execution. You have to use a static variable or something like that.

if (mystaticvariable) { DBLog...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.