1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
//
// SPUPluginController.m
// PeopsSPU
//
// Created by C.W. Betts on 7/2/13.
//
//
#import "SPUPluginController.h"
@implementation SPUPluginController
static Class GetSPUBaseClass()
{
static Class spuBaseClass;
if (!spuBaseClass) {
spuBaseClass = [SPUPluginController class];
}
return spuBaseClass;
}
static inline void FuncNotAvailable(id sel, id sender, SEL theCmd)
{
#ifdef DEBUG
NSString *selString = NSStringFromSelector(theCmd);
if (sender) {
NSLog(@"Class %@ does not implement %@, and was sent a(n) %@ with the description %@", [sel class], selString, [sender class], [sender description]);
} else {
NSLog(@"Class %@ does not implement %@", [sel class], selString);
}
if ([sel isMemberOfClass:GetSPUBaseClass()]) {
NSLog(@"For one thing, the class %@ isn't supposed to be accessed directly, just subclassed!", GetSPUBaseClass()); \
} else {
NSLog(@"You should implement %@ for your class %@. As it is, you are calling %@ from the superclass %@.", selString, [sel class], selString, GetSPUBaseClass());
}
#endif
[sel doesNotRecognizeSelector:theCmd];
}
#define NotAvailableWarn(sender) FuncNotAvailable(self, sender, _cmd)
- (IBAction)cancel:(id)sender
{
NotAvailableWarn(sender);
}
- (IBAction)ok:(id)sender
{
NotAvailableWarn(sender);
}
- (IBAction)reset:(id)sender
{
NotAvailableWarn(sender);
}
- (void)loadValues
{
NotAvailableWarn(nil);
}
@end
|