Skip to content

Commit 67f1ef6

Browse files
committed
Comment out debug code for #2297
1 parent 0a7dcf0 commit 67f1ef6

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

Source/SPObjectAdditions.m

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,39 @@ - (BOOL)isInArray:(NSArray *)list
5151

5252
@end
5353

54-
#pragma mark -
55-
56-
@interface NSAlert (ApplePrivate)
57-
58-
- (IBAction)buttonPressed:(id)sender;
59-
60-
@end
61-
62-
@implementation NSAlert (SPAlertDebug)
63-
64-
+ (void)load
65-
{
66-
static dispatch_once_t onceToken;
67-
68-
dispatch_once(&onceToken, ^{
69-
Class alertClass = [self class];
70-
71-
SEL orig = @selector(buttonPressed:);
72-
SEL exch = @selector(sp_buttonPressed:);
73-
74-
Method origM = class_getInstanceMethod(alertClass, orig);
75-
Method exchM = class_getInstanceMethod(alertClass, exch);
76-
77-
method_exchangeImplementations(origM, exchM);
78-
});
79-
}
80-
81-
- (IBAction)sp_buttonPressed:(id)obj
82-
{
83-
NSLog(@"%s of %@ title=\n%@\ntext=\n%@",__func__,self,[self messageText],[self informativeText]);
84-
85-
[self sp_buttonPressed:obj];
86-
}
87-
88-
@end
54+
// method swizzling to try and reproduce #2297
55+
//#pragma mark -
56+
//
57+
//@interface NSAlert (ApplePrivate)
58+
//
59+
//- (IBAction)buttonPressed:(id)sender;
60+
//
61+
//@end
62+
//
63+
//@implementation NSAlert (SPAlertDebug)
64+
//
65+
//+ (void)load
66+
//{
67+
// static dispatch_once_t onceToken;
68+
//
69+
// dispatch_once(&onceToken, ^{
70+
// Class alertClass = [self class];
71+
//
72+
// SEL orig = @selector(buttonPressed:);
73+
// SEL exch = @selector(sp_buttonPressed:);
74+
//
75+
// Method origM = class_getInstanceMethod(alertClass, orig);
76+
// Method exchM = class_getInstanceMethod(alertClass, exch);
77+
//
78+
// method_exchangeImplementations(origM, exchM);
79+
// });
80+
//}
81+
//
82+
//- (IBAction)sp_buttonPressed:(id)obj
83+
//{
84+
// NSLog(@"%s of %@ title=\n%@\ntext=\n%@",__func__,self,[self messageText],[self informativeText]);
85+
//
86+
// [self sp_buttonPressed:obj];
87+
//}
88+
//
89+
//@end

0 commit comments

Comments
 (0)