FROM : Carlos Salinas
DATE : Mon May 12 18:08:16 2008
I have an NSProxy subclass that logs the methods sent to a target
object.
I use the class to test my code. I log the methods into an array. I
then compare that array of strings with an expected array of strings.
This is useful for verifying that messages between layers and
delegates are occuring and in the right order.
Call -setExcludedMethods: to specify the methods that are not to be
logged. Here's a usage example:
// Replace the view with a TestProxy that logs the methods sent
to the view.
id documentView = [scrollView documentView];
id documentViewProxy = [[TestProxy alloc]
initWithTarget:documentView];
// Set the methods that are not logged.
NSSet *excludedMethods = [NSSet setWithObjects:
@"hitTest:", // Too many of these. Ignore.
@"toolTip",
@"inLiveResize",
nil
];
[documentViewProxy setExcludedMethods:excludedMethods];
'Los
<email_removed>
On May 9, 2008, at 8:44 PM, Matt James wrote:
> Is there any way to overload a class in such a manner as to print
> out every
> method call it makes at any given time before it runs the method?
> Right
> now, I'm overloading a few methods of this particular class and
> putting
> NSLog's at the first line, but I was wondering if there was a way to
> jump in
> before _ALL_ methods on an object and perform this particular task.
> Thanks for any help!
>
> -Matt
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
DATE : Mon May 12 18:08:16 2008
I have an NSProxy subclass that logs the methods sent to a target
object.
I use the class to test my code. I log the methods into an array. I
then compare that array of strings with an expected array of strings.
This is useful for verifying that messages between layers and
delegates are occuring and in the right order.
Call -setExcludedMethods: to specify the methods that are not to be
logged. Here's a usage example:
// Replace the view with a TestProxy that logs the methods sent
to the view.
id documentView = [scrollView documentView];
id documentViewProxy = [[TestProxy alloc]
initWithTarget:documentView];
// Set the methods that are not logged.
NSSet *excludedMethods = [NSSet setWithObjects:
@"hitTest:", // Too many of these. Ignore.
@"toolTip",
@"inLiveResize",
nil
];
[documentViewProxy setExcludedMethods:excludedMethods];
'Los
<email_removed>
On May 9, 2008, at 8:44 PM, Matt James wrote:
> Is there any way to overload a class in such a manner as to print
> out every
> method call it makes at any given time before it runs the method?
> Right
> now, I'm overloading a few methods of this particular class and
> putting
> NSLog's at the first line, but I was wondering if there was a way to
> jump in
> before _ALL_ methods on an object and perform this particular task.
> Thanks for any help!
>
> -Matt
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
| Related mails | Author | Date |
|---|---|---|
| Matt James | May 10, 05:44 | |
| Christiaan Hofman | May 10, 13:11 | |
| Jonathon Mah | May 10, 15:49 | |
| objectwerks inc | May 10, 18:32 | |
| Bill Bumgarner | May 10, 19:48 | |
| Gerd Knops | May 10, 20:34 | |
| Scott Little | May 10, 23:34 | |
| Stéphane Corthésy | May 11, 11:53 | |
| Matt James | May 11, 15:33 | |
| objectwerks inc | May 12, 01:45 | |
| Scott Little | May 12, 13:02 | |
| Carlos Salinas | May 12, 18:08 |






Cocoa mail archive

