debugging - How to make debug code using #ifdef directive. Objective-c -


i want make question developing using #ifdef directive.

i want make code in objective-c debug use, example:

in main function this:

#define debug_level 

in interface this:

#ifdef debug_level bool editorisdragged; bool editorisselected; #endif 

.... other property

#ifdef #debug_level @property (nonatomic, readwrite) bool editorisdragged; @property (nonatomic, readwrite) bool editorisselected; #endif 

then in implementation this:

#ifdef #debug_level @synthetize editorisdragged, editorisselected; #endif 

but receve error because in synthetize editorisdragged , editorisselected not defined. if try define own setter/getter method receive same error, because vars (editorisdragged , editorisselected) not exist xcode!

i in c use method write debug code, in obj-c must use??

thank you!

shouldn't put #define debug_level in header file gets included in places needs know it? setting in in build settings or putting in *.pch. , i'm not sure if typo have #define #debug_level (see second hash?) in code here.


Comments