Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Handle NSLog in iPhone sdk

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 214
    Comment on it

    Through this code we can use NSLOG whenever required. Write this snippet in some common file(say utility) so that it would be easily handled throughout the project.
    Make sure class should import utility class to handle NSLog. All you need is to change the debugging mode(APP_DEBUG_MODE) in this code. Set the debugging mode(APP_DEBUG_MODE) to 1 when you want NSLOG to work otherwise 0.

    #define APP_DEBUG_MODE 1  // 1  if DEBUG_MODE is ON, 0 for OFF
    #if APP_DEBUG_MODE
    #define NSLog(...) NSLog(@"%s %@", PRETTY_FUNCTION, [NSString stringWithFormat:__VA_ARGS__])
    #else
    #define NSLog(...) do { } while ( 0 )
    #endif
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: