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

  • SEARCH
  • Home
  • 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 7561483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:10:19+00:00 2026-05-30T13:10:19+00:00

Would you rather recommend using NSLog or the logging feature provided by Xcode for

  • 0

Would you rather recommend using NSLog or the logging feature provided by Xcode for breakpoints for debugging?

Is there any advantage of using NSLog?

For apps which are running on customer devices: Is there a easy way to log the NSLog or equivalent output to a file or web service?

  • 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-05-30T13:10:20+00:00Added an answer on May 30, 2026 at 1:10 pm

    Personally, I would recommend using both logging (via NSLog) as well as setting breakpoints. Perhaps your question is when you should use one versus the other.

    Advantages of Debugging via Breakpoints / GDB

    • Stops flow of program (use logging if you don’t want to stop flow of program)
    • Shows all local variables
    • Can pass objective c messages and make c calls. Flexible way of on the fly answering questions you may have about the current state.

    Breakpoints are nice when you want to get into the code and step by step observe whats going on. Some advantages to stepping through the code include being able to examine any variable you like and being able to execute code via gdb (see Objective-C Debugging tips in Xcode4? for more on gdb tips). Breakpoints are also convenient since you don’t have to recompile and add log statements.

    Also see How to set a conditional breakpoint in Xcode based on an object string property?

    Advantages of Logging

    • Does not interrupt flow of program
    • Provides a way of aggregating debugging data
    • Can be viewed on others devices via Organizer
    • If you use TestFlight with the TestFlight SDK, you can capture logs in sessions, which is particularly nice when the app crashes.

    Logs are nice for information you always want to see. For example, an app that downloads resources might want to log each resource that was downloaded (url and whatever other info you may wish). I like to create conditional logs using a macro called DLOG so that I can see more verbose logs just for development but strip these out for release builds.

    DLog (Logging for DEBUG Builds Only)

    #ifdef DEBUG
        #define DLog(...) NSLog(__VA_ARGS__)
    #else
        #define DLog(...) /* */
    #endif
    

    This will only emit NSLog messages for a DEBUG build. You could add similar functionality to facilitate a form of verbose logging for a complicated part of your app. When I’m debugging dragging problems, I find it’s often nice to have logs just to watch what’s going on (rather than step through everything). However, when I’m done developing the feature or fixing the issue, I definitely am no longer interested in these logs, so I’ll typically conditionally show these logs so that if I run into an issue later I can once again view the logs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the asp:TreeView and would really rather just output it to a standard
I have an IList<T> that I need to sort, and I would rather not
Would you rather use a version number (that will increment) or a timestamp to
What would you rather choose to implement deque: HashSet or LinkedList. And could you
I'm trying to do something which I figure would be rather easy, though I'm
When starting out with a new application, would you rather just use an existing
Why would you do an automatic HTML post rather than a simple redirect? Is
Rather than reinvent the wheel I would like to use Outlook to manage my
I would like to ask a rather, general, high-level introductory kind of question regarding
I would like to create my ObjectDataProvider in my C# code behind rather than

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.