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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:49:18+00:00 2026-06-04T20:49:18+00:00

Possible Duplicate: Intercept method call in Objective-C How to log all methods used in

  • 0

Possible Duplicate:
Intercept method call in Objective-C
How to log all methods used in iOS app

For example, a UIViewController object in iOS receives many messages before its view is shown to a user:

  1. viewWillAppear
  2. viewWillLayoutSubviews
  3. viewDidLayoutSubviews
  4. viewDidAppear
  5. …

because the framework’s source code is not viewable, we have to rely on books or blogs, or is there a way to print out or monitor all the messages sent to this object by (1) Objective-C, or (2) by any tool?

  • 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-04T20:49:19+00:00Added an answer on June 4, 2026 at 8:49 pm

    Rather than my comment, the best approach that I used (and still use) is calling:

    (void)instrumentObjcMessageSends(YES);
    

    When I need to start logging all messages and then:

    (void)instrumentObjcMessageSends(NO);
    

    Don’t forget to add #import <objc/runtime.h>.
    When I don’t need it anymore. The annoying thing is that the log is created under /tmp/msgSends- and this means that you have to open the terminal and use tail to see it in a readable way.

    What is printed is something like this:

    - CustomTableViewController UIViewController _parentModalViewController
    - CustomTableViewController UIViewController isPerformingModalTransition
    - CustomTableViewController UIViewController setInAnimatedVCTransition:
    - CustomTableViewController UIViewController viewWillMoveToWindow:
    - CustomTableViewController UIViewController isPerformingModalTransition
    - CustomTableViewController UIViewController parentViewController
    - CustomTableViewController UIViewController _popoverController
    - CustomTableViewController UIViewController _didSelfOrAncestorBeginAppearanceTransition
    - CustomTableViewController UIViewController parentViewController
    - CustomTableViewController UIViewController __viewWillDisappear:
    - CustomTableViewController UIViewController _setViewAppearState:isAnimating:
    - CustomTableViewController UIViewController automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers
    

    Note: It has been a while since I used this approach for the last time and it looks like this approach doesn’t log private methods subclassed. So, if you have a DummyClass with -(void)_dummyMethod as private and then a DummySubClass with a -(void)_dummyMethod implementation, the message will not be logged.

    For iOS, this works only on Simulator.

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

Sidebar

Related Questions

Possible Duplicate: Supporting Open In… menu item in my app for iOS Mail And
Possible Duplicate: Javascript Object.Watch for all browsers? I just read Mozilla's documentation for the
Possible Duplicate: Avoid resending forms on php pages Index.html <form method=post action=demo.php> <input type=text
Possible Duplicate: <blink> tag in Internet Explorer Hai I have used blink tag to
Possible Duplicate: Why does Android app run in small window on tablet emulator? i
Possible Duplicate: Is it better to call ToList() or ToArray() in LINQ queries? I
Possible Duplicate: launch facebook app from other app Im a beginner with facebook api
Possible Duplicate: Can .NET intercept and change css files? I have configured IIS6 to
Possible Duplicate: Best way to stream MP3 from an iPhone app? Hi, could any
Possible Duplicate: Why is the `gets' function is dangerous? Why should not be used?

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.