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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:19:13+00:00 2026-05-12T17:19:13+00:00

How would I find out where a method was called from? Like you see

  • 0

How would I find out where a method was called from? Like you see in a stack trace.

Basically, just to explain, I am observing a core data property and the method that gets called when the property changes calls another method (the IBAction) but in this IBAction it adds Core Data objects which triggers the KVO method which triggers the IBAction and so forth. That is why I was trying to figure out where the method was called from so I could stop this infinite loop.

  • 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-12T17:19:13+00:00Added an answer on May 12, 2026 at 5:19 pm

    You can’t without going to great lengths to duplicate the functionality of the debugger, dtrace, and/or the various other tools that do exactly this kind of thing. It is remarkably architecture dependent and rife with special cases and situations that flat out don’t work.

    You certainly would never want to do such a thing in production code. For debugging, there are enough tools that do this in enough contexts that there is no need to do so.

    What are you trying to do?

    Basically i’m using KVO and if the KVO
    method is triggered from another
    method which is an IBAction I don’t
    what it to do what it would normally
    do otherwise it would go into a loop
    (related to my earlier question).

    Down this path lies madness. It totally breaks encapsulation to have a method whose execution is impacted by a caller without their being some kind of explicit argument or implicit configuration indicating that the behavior should change.

    If you are ending up in an infinite loop, then I would suggest revisiting your overall architecture.

    In particular, when a KVO notification fires, it should almost never trigger a KVO notification of the same property either directly or indirectly. In the exceedingly rare case where this is unavoidable, you should make sure you do the KVO triggers by hand using -willChangeValueForKey: and -didChangeValueForKey: conditionally.

    Basically, just to explain, I am
    observing a core data property and the
    method that gets called when the
    property changes calls another method
    (the IBAction) but in this IBAction it
    adds Core Data objects which triggers
    the KVO method which triggers the
    IBAction and so forth. That is why I
    was trying to figure out where the
    method was called from so I could stop
    this infinite loop

    In other words, you have a model layer change that is then calling a method at the interface between view layer and control layer (the IBAction method) that then, not surprisingly, triggers another model level change which then goes off the rails….

    Once your observer fires and you need to make a change in the model as a result, you should keep all of the change logic within the model layer. It is your model, after all, and it should have the smarts to apply changes appropriately.

    What should never happen is that the control layer or view layer triggers changes to the model in response to the model changing. Changes to the model — to the data — from the control/view layer should only ever occur in response to user action or some external event (a timer, perchance).

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

Sidebar

Ask A Question

Stats

  • Questions 254k
  • Answers 254k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The real answer to this question is I gave up.… May 13, 2026 at 10:11 am
  • Editorial Team
    Editorial Team added an answer For us, the version control isn't as important as the… May 13, 2026 at 10:11 am
  • Editorial Team
    Editorial Team added an answer Without resorting to some 3rd party tools, the easiest way… May 13, 2026 at 10:11 am

Related Questions

I would be interested to learn about large scale development in Python and especially
I have couple questions regarding some C++ rules. Why am I able to call
A RIA Domain service has this method... public virtual CmsDealer GetCmsDealer(string id) { return
I'm trying to figure out the cleanest way to do this. Currently I have

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.