Просмотр исходного кода

FLEXMethod.imagePath should use the method's IMP

We can already tell which image the class comes from, and that is usually the same as the original method implementation. What is more useful to know is the image of the _current_ implementation.
Tanner Bennett лет назад: 5
Родитель
Сommit
d3c3c61ab1
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Classes/Utility/Runtime/Objc/Reflection/FLEXMethod.m

+ 1 - 1
Classes/Utility/Runtime/Objc/Reflection/FLEXMethod.m

@@ -183,7 +183,7 @@
 - (NSString *)imagePath {
 - (NSString *)imagePath {
     if (!_imagePath) {
     if (!_imagePath) {
         Dl_info exeInfo;
         Dl_info exeInfo;
-        if (dladdr(_objc_method, &exeInfo)) {
+        if (dladdr(_implementation, &exeInfo)) {
             _imagePath = exeInfo.dli_fname ? @(exeInfo.dli_fname) : @"";
             _imagePath = exeInfo.dli_fname ? @(exeInfo.dli_fname) : @"";
         }
         }
     }
     }