Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8270063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:26:47+00:00 2026-06-08T06:26:47+00:00

In my memory, there’s some code that can let the NSLog not work when

  • 0

In my memory, there’s some code that can let the NSLog not work when released.

I don’t want to remove my NSLog in my code.It helps a lot on debug mode.

So I want to find a way that can leave them in my code, and also don’t slow down the application when released.

Thanks for your help~~

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:26:49+00:00Added an answer on June 8, 2026 at 6:26 am

    A common way to remove all NSLog(…) call in a release is to create a macro that is between conditional preprocessor macro and compiles to nothing, something like this:

    #ifdef RELEASE
    # define NSLog(...) //remove loggin in production
    #endif
    

    Put this code in a .h file that is included in every other file, like a Defines.h that is #include‘d in the prefix header (.pch).

    RELEASE should be a preprocessor macro defined against the Release configuration in the "Build Settings" tab of your target.

    Apple LLVM compiler 4.0 - Preprocessing

    Related Questions

    • Is it true that one should not use NSLog() on production code?
    • How to print out the method name and line number and conditionally disable NSLog?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are a few things that I don't understand about iOS memory management. I
I have a wpf application that is leaking memory...is there a way to detect
There is a memory leak in a legacy application, so I don't know the
There are some memory leaks found out when i profile my app with Instruments.
Given a resource dictionary loading some static resources into memory - is there any
I've built some Types dynamically using System.CodeDom.CodeCompileUnit, want to compile those into IL code
Is this function guaranteed not to create any memory leaks (there is no additional
Is there a setting by which I can get some scripts to load/execute automatically
In memory there is a section called stack that starts at the top and
I know there are memory caches so that using values from a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.