Permalink
Browse files

Comment out debug code for #2297

  • Loading branch information...
abhibeckert committed Mar 4, 2016
1 parent 0a7dcf0 commit 67f1ef6e43027380cbdc976115164fbeee1c2dc2
Showing with 36 additions and 35 deletions.
  1. +36 −35 Source/SPObjectAdditions.m
@@ -51,38 +51,39 @@ - (BOOL)isInArray:(NSArray *)list
@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
// method swizzling to try and reproduce #2297
//#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

0 comments on commit 67f1ef6

Please sign in to comment.