• 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: "Martin" <email@hidden>
  • Date: Wed, 07 Jul 2004 12:44:09 -0700

If you want to log all calls to all instances of your class, rather than replacing all [[MyButton alloc] init] methods in your code, you could just change your init method to return the proxy. For instance, MyButton's init method may look like:

- (id) init
{
// normal initialization
if( self = [super init] ) {
// setup ivars
}

// return proxy instead of ourself
id proxy = [[MyProxy alloc] initWithTarget:self];
[self release];
return proxy;
}

This way you only have one source file to modify when you want to switch your proxy on/off.

~Martin


On July 07 2004, Tim Hewett <email@hidden> wrote:

>So instead of:
>
> MyButton *button = [[MyButton alloc] init]; // or whatever you do to
>create the button
>
>you do:
>
> MyButton *tmpButton = [[MyButton alloc] init]; // or whatever you do
>to create the button
> id button = [[TargetProxy alloc] initWithTarget:tmpButton];
>
> // continue making calls to button, forget it is a proxy
_______________________________________________
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.


  • Prev by Date: Chaning Desktop picture with cocoa
  • Next by Date: Bidirectional up/down triangles in NSAttributedString?
  • Previous by thread: Re: Debugging a specific object
  • Next by thread: System Menu?
  • Index(es):
    • Date
    • Thread