diff options
Diffstat (limited to 'Source/SPObjectAdditions.m')
-rw-r--r-- | Source/SPObjectAdditions.m | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/Source/SPObjectAdditions.m b/Source/SPObjectAdditions.m index 9f51d652..f29aa3b4 100644 --- a/Source/SPObjectAdditions.m +++ b/Source/SPObjectAdditions.m @@ -140,7 +140,7 @@ retryDescribe: if([notificationObserver isKindOfClass:[NSView class]]) { [val appendFormat:@" view info: id=%@, tag=%ld\n",[(NSView *)notificationObserver identifier], [(NSView *)notificationObserver tag]]; } - [val appendFormat:@"\nbacktrace:\n%@\n\n",[NSThread callStackSymbols]]; + [val appendFormat:@"\nregistration backtrace:\n%@\n\n",[NSThread callStackSymbols]]; [gScrollViewListeners setObject:val forKey:key]; } @@ -186,3 +186,39 @@ retryDescribe: @end + +#pragma mark - + +@interface NSAlert (ApplePrivate) + +- (IBAction)buttonPressed:(id)sender; + +@end + +@implementation NSAlert (SPAlertDebug) + ++ (void)load +{ + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + Class alertClass = [self class]; + + SEL orig = @selector(buttonPressed:); + SEL exch = @selector(sp_buttonPressed:); + + Method origM = class_getInstanceMethod(alertClass, orig); + Method exchM = class_getInstanceMethod(alertClass, exch); + + method_exchangeImplementations(origM, exchM); + }); +} + +- (IBAction)sp_buttonPressed:(id)obj +{ + NSLog(@"%s of %@ title=\n%@\ntext=\n%@",__func__,self,[self messageText],[self informativeText]); + + [self sp_buttonPressed:obj]; +} + +@end |