Przeglądaj źródła

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 12 lat temu
rodzic
commit
cad1eb4a9b

+ 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];
 }