Re: Debugging a specific object
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.