Explorar el Código

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 hace 12 años
padre
commit
cad1eb4a9b
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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];
 }