• 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: Debugging a specific object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging a specific object


  • Subject: Re: Debugging a specific object
  • From: Tim Hewett <email@hidden>
  • Date: Wed, 7 Jul 2004 15:19:55 +0100

Louis,

Absolutely fantastic, thank you so, so much. Even better there is
a real life example of NSProxy in use in the developer examples
for 10.3, in /Developer/Examples/Foundation/ForwardInvocation,
virtually a case of "paste and go".

I never knew about NSProxy, but this is one very useful class, it
does exactly what you describe.

Thanks again, in 15 minutes I've now solved the problem which
several days have been thrown at (which was caused by there being
a hidden method in NSCell called when the view needs to discover
whether a cell needs to be redrawn when the window changes key
state - documentation please someone at Apple!).

Regards,

Tim.


On 7 Jul 2004, at 11:37, Louis C. Sacha wrote:

Hello...

You could create a simple subclass of NSProxy that either logs the method that is being called in it's implementation of forwardInvocation:, or has a breakpoint set within the forwardInvocation: method.

Instead of using or returning your object directly, return the proxy to the object.

If your object is a view that is created in a nib, you'll need an outlet to the view and you can replace it with a proxy in the awakeFromNib method by doing the following:

[[problemView superview] replaceSubview:problemView with:(NSView *)proxyForProblemView];

Note: if you use the outlet for anything other than making the switch, you'll want to change the outlet to point to the proxy as well.


Hope that helps,

Louis


Hi,

I'm just wondering if there is a way to have the XCode
debugger trace or break each time a particular Objective
C object receives a call to any of its selectors, including
those it has inherited from a higher class. I need to be
able to see how Cocoa is calling my object as it is being
displayed differently to how I want it to be, and so far
attempts to debug by overloading inherited methods have
been fruitless.

Normally XCode lets you break in specific methods, but
I need to have it do this for all methods in a specific object.

Any help greatly appreciated.

Regards,

Tim.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Debugging a specific object
      • From: Jamie <email@hidden>
References: 
 >Debugging a specific object (From: Tim Hewett <email@hidden>)
 >Re: Debugging a specific object (From: "Louis C. Sacha" <email@hidden>)

  • Prev by Date: **SOLVED** Custom "ButtonAndText" cell in NSOpenPanel accessory view
  • Next by Date: NSOpenPanel shouldShowFilename delegate, or how to display a list of applications
  • Previous by thread: Re: Debugging a specific object
  • Next by thread: Re: Debugging a specific object
  • Index(es):
    • Date
    • Thread