|
@@ -11,24 +11,27 @@
|
|
@implementation NSHashTable (MKRRadioManagerAdd)
|
|
@implementation NSHashTable (MKRRadioManagerAdd)
|
|
|
|
|
|
- (void)makeObjectsPerformSelectorWithObjects:(SEL)sel, ...{
|
|
- (void)makeObjectsPerformSelectorWithObjects:(SEL)sel, ...{
|
|
- for (id obj in self) {
|
|
|
|
- if (![obj respondsToSelector:sel]) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- NSMethodSignature *sig = [obj methodSignatureForSelector:sel];
|
|
|
|
- if (!sig) {
|
|
|
|
- [obj doesNotRecognizeSelector:sel];
|
|
|
|
- }
|
|
|
|
- NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig];
|
|
|
|
- if (!invocation) {
|
|
|
|
- [obj doesNotRecognizeSelector:sel];
|
|
|
|
|
|
+ va_list args;
|
|
|
|
+ va_start(args, sel);
|
|
|
|
+ NSArray *allObject = self.allObjects;
|
|
|
|
+ for (NSInteger i = 0; i<allObject.count; i++) {
|
|
|
|
+ if (allObject.count > i) {
|
|
|
|
+ id obj = allObject[i];
|
|
|
|
+ if ([obj respondsToSelector:sel]) {
|
|
|
|
+ NSMethodSignature *sig = [obj methodSignatureForSelector:sel];
|
|
|
|
+ if (!sig) {
|
|
|
|
+ [obj doesNotRecognizeSelector:sel];
|
|
|
|
+ }
|
|
|
|
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig];
|
|
|
|
+ if (!invocation) {
|
|
|
|
+ [obj doesNotRecognizeSelector:sel];
|
|
|
|
+ }
|
|
|
|
+ [invocation setTarget:obj];
|
|
|
|
+ [invocation setSelector:sel];
|
|
|
|
+ [self setInv:invocation withSig:sig andArgs:args];
|
|
|
|
+ [invocation invoke];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- [invocation setTarget:obj];
|
|
|
|
- [invocation setSelector:sel];
|
|
|
|
- va_list args;
|
|
|
|
- va_start(args, sel);
|
|
|
|
- [self setInv:invocation withSig:sig andArgs:args];
|
|
|
|
- [invocation invoke];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|