• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Understanding the inner workings: getting to know how functions are called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding the inner workings: getting to know how functions are called


  • Subject: Re: Understanding the inner workings: getting to know how functions are called
  • From: Mattias Arrelid <email@hidden>
  • Date: Wed, 23 Jan 2008 09:38:44 +0100


On 22 jan 2008, at 17.26, Kyle Sluder wrote:

On 1/22/08, Mattias Arrelid <email@hidden> wrote:
Could anyone point me in the right direction here? I'm open to all
suggestions...

I'd create a subclass of NSProxy, override -methodSignatureForSelector: and -forwardInvocation: appropriately (perhaps putting a breakpoint in -forwardInvocation: that prints a backtrace and auto-continues), and return an instance of this from your real object's -init method. If you do it right, clients of your class should be none the wiser.

Hm... this might work when the instance is called from an external instance, but internal calls wouldn't be called since they've by then already have passed the proxy object, right? E.g. when I perform a selector on the instance I'm proxying for, and that method calls other methods that belongs to that very instance (say e.g. drawRect: has calls drawUpperPart:, drawLowerPart: etc.), those functions won't be logged, since we're not going through the proxy object any longer.


Thanks again for your ideas and suggestions.
Mattias


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Understanding the inner workings: getting to know how functions are called (From: Mattias Arrelid <email@hidden>)
 >Re: Understanding the inner workings: getting to know how functions are called (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Sortable Table Column with Custom Appearance
  • Next by Date: Re: [[NSView animator] setHidden:YES] doesn't fade?
  • Previous by thread: Re: Understanding the inner workings: getting to know how functions are called
  • Next by thread: Re: Understanding the inner workings: getting to know how functions are called
  • Index(es):
    • Date
    • Thread