Quellcode durchsuchen

Go back to using [[object class] description]

We changed to the runtime functions to work better with objects that don’t inherit from NSObject, but object_getClass returns the actual class of the object, which is not always what we want. If the object is observed, we get the NSKVONotifying_ prefix due to the dynamic subclassing.
Ryan Olson vor 12 Jahren
Ursprung
Commit
cad1eb4a9b
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      Classes/Object Explorers/FLEXObjectExplorerViewController.m

+ 2 - 1
Classes/Object Explorers/FLEXObjectExplorerViewController.m

@@ -133,7 +133,8 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
 - (void)setObject:(id)object
 {
     _object = object;
-    self.title = @(class_getName(object_getClass(object)));
+    // Use [object class] here rather than object_getClass because we don't want to show the KVO prefix for observed objects.
+    self.title = [[object class] description];
     [self updateTableData];
 }