About the first question, yes, you can archive the application in debug mode. From Xcode, browse the Product, Schema, Schema Management, Edit menus. Select the Archive action in the left pane and select Debug as the Assembly Configuration from the drop-down list.
If you want to limit logging to Debug configurations only, you can add this to your ProjectName-Prefix.pch :
#ifdef DEBUG #define XYZLog(format, ...) NSLog(format, ## __VA_ARGS__) #else #define XYZLog(format, ...) #endif
Where "XYZ" is the three-letter prefix for your application (Cocoa naming convention).
Then you should use XYZLog instead of NSLog in your code, and the output will only go to the console for Debug versions.
Daniel Martรญn
source share