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 770461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:30:15+00:00 2026-05-14T18:30:15+00:00

I wrote a debug macro that prints to the console the passed-in string whenever

  • 0

I wrote a debug macro that prints to the console the passed-in string whenever the global kDebug flag == YES.

I need to print out the name of a method and its class name whenever any method is called.

That works fine when I painstakingly go through every method and write the name of the class and the method in a string.

Is there any special handler that gets called when any method in Objective-C is called, and if so, is there a way that I can somehow override it to call my debug macro?

The entire purpose of this is so that I don’t have to go through every method in my code and hand-code the method signature in the debug macro call.

  • 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-14T18:30:16+00:00Added an answer on May 14, 2026 at 6:30 pm

    If you’re looking for a method logging facility, rather than build your own, one is actually built into the Objective-C runtime.

    You might want to read over the Objective-C section of Apple’s Technote 2124:
    Technical Note TN2124: Mac OS X Debugging Magic

    I would also recommend reading over Dave Dribin’s blog posting about using the runtime’s facility for tracing messages. You can find that here: Tracing Objective-C messages – Dave Dribin’s Blog. Dave notes a logObjCMessageSend function that gets called, which you could use to customize your logging behavior. It’s a little tricky to use, but Dave gives the info necessary to successfully use it.

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

Sidebar

Related Questions

I've wrote a simple driver that only prints Hello World to the debug. I
I'm trying to write a macro that toggles between release/debug solution configurations in Visual
I wrote a console application project. When I debug it through visual studio 2010
Lets write simple console application (debug mode): static void Main(string[] args) { Process p
I have a test program that I wrote to try and debug a GMutex
I'm trying to debug some code that another developer wrote in jquery since page
I write the following macro for debug convinience, 1 #ifndef DEF_H 2 #define DEF_H
I'm attempt to debug a program I wrote, but I'm running into a problem
I am doing project in powerpoint 2007 automation. In that i am using macro
I wrote simple application that using the cell phone camera. When i trying to

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.