|
@@ -109,7 +109,6 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
@@ -109,7 +109,6 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
109
|
}
|
109
|
}
|
110
|
|
110
|
|
111
|
}
|
111
|
}
|
112
|
-
|
|
|
113
|
- (void)yher_tableViewSetDelegate:(id<UITableViewDelegate>)delegate {
|
112
|
- (void)yher_tableViewSetDelegate:(id<UITableViewDelegate>)delegate {
|
114
|
[self yher_tableViewSetDelegate:delegate];
|
113
|
[self yher_tableViewSetDelegate:delegate];
|
115
|
|
114
|
|
|
@@ -123,10 +122,10 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
@@ -123,10 +122,10 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
123
|
Class delegateClass = [delegate class];
|
122
|
Class delegateClass = [delegate class];
|
124
|
|
123
|
|
125
|
SEL swizzleMethodSEL = NSSelectorFromString(@"yher_tableViewDidSelectRowAtIndexPath");
|
124
|
SEL swizzleMethodSEL = NSSelectorFromString(@"yher_tableViewDidSelectRowAtIndexPath");
|
126
|
-
|
125
|
+
|
127
|
Method originMethod = class_getInstanceMethod(delegateClass, originMethodSEL);
|
126
|
Method originMethod = class_getInstanceMethod(delegateClass, originMethodSEL);
|
128
|
|
127
|
|
129
|
- Class class = GetSelectorInsClass(delegateClass,originMethodSEL,originMethod);
|
128
|
+ Class class = GetTableViewSelectorInsClass(delegateClass,originMethodSEL,originMethod);
|
130
|
|
129
|
|
131
|
if (class_addMethod(class, swizzleMethodSEL, (IMP)yher_tableViewDidSelectRowAtIndexPath, "v@:@@")) {
|
130
|
if (class_addMethod(class, swizzleMethodSEL, (IMP)yher_tableViewDidSelectRowAtIndexPath, "v@:@@")) {
|
132
|
Method swizzleMethod = class_getInstanceMethod(class, swizzleMethodSEL);
|
131
|
Method swizzleMethod = class_getInstanceMethod(class, swizzleMethodSEL);
|
|
@@ -138,7 +137,7 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
@@ -138,7 +137,7 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
138
|
}
|
137
|
}
|
139
|
}
|
138
|
}
|
140
|
|
139
|
|
141
|
-Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
|
140
|
+Class GetTableViewSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
|
142
|
Class super_class = [hclass superclass];
|
141
|
Class super_class = [hclass superclass];
|
143
|
if (!super_class) {
|
142
|
if (!super_class) {
|
144
|
return hclass;
|
143
|
return hclass;
|
|
@@ -147,7 +146,6 @@ Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) { |
|
@@ -147,7 +146,6 @@ Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) { |
147
|
if (method != sel_method) {
|
146
|
if (method != sel_method) {
|
148
|
return hclass;
|
147
|
return hclass;
|
149
|
}
|
148
|
}
|
150
|
- return GetSelectorInsClass(super_class, sel, sel_method);
|
149
|
+ return GetTableViewSelectorInsClass(super_class, sel, sel_method);
|
151
|
}
|
150
|
}
|
152
|
-
|
|
|
153
|
@end |
151
|
@end |