|
@@ -11,6 +11,7 @@
|
|
|
#import "FLEXObjectExplorerViewController.h"
|
|
#import "FLEXObjectExplorerViewController.h"
|
|
|
#import "FLEXRuntimeUtility.h"
|
|
#import "FLEXRuntimeUtility.h"
|
|
|
#import "FLEXUtility.h"
|
|
#import "FLEXUtility.h"
|
|
|
|
|
+#import "FLEXHeapEnumerator.h"
|
|
|
|
|
|
|
|
@interface FLEXInstancesTableViewController ()
|
|
@interface FLEXInstancesTableViewController ()
|
|
|
|
|
|
|
@@ -18,6 +19,24 @@
|
|
|
|
|
|
|
|
@implementation FLEXInstancesTableViewController
|
|
@implementation FLEXInstancesTableViewController
|
|
|
|
|
|
|
|
|
|
++ (instancetype)instancesTableViewControllerForClassName:(NSString *)className
|
|
|
|
|
+{
|
|
|
|
|
+ const char *classNameCString = [className UTF8String];
|
|
|
|
|
+ NSMutableArray *instances = [NSMutableArray array];
|
|
|
|
|
+ [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id object, __unsafe_unretained Class actualClass) {
|
|
|
|
|
+ if (strcmp(classNameCString, class_getName(actualClass)) == 0) {
|
|
|
|
|
+ // Note: objects of certain classes crash when retain is called. It is up to the user to avoid tapping into instance lists for these classes.
|
|
|
|
|
+ // Ex. OS_dispatch_queue_specific_queue
|
|
|
|
|
+ // In the future, we could provide some kind of warning for classes that are known to be problematic.
|
|
|
|
|
+ [instances addObject:object];
|
|
|
|
|
+ }
|
|
|
|
|
+ }];
|
|
|
|
|
+ FLEXInstancesTableViewController *instancesViewController = [[self alloc] init];
|
|
|
|
|
+ instancesViewController.instances = instances;
|
|
|
|
|
+ instancesViewController.title = [NSString stringWithFormat:@"%@ (%lu)", className, (unsigned long)[instances count]];
|
|
|
|
|
+ return instancesViewController;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
- (BOOL)prefersStatusBarHidden
|
|
- (BOOL)prefersStatusBarHidden
|
|
|
{
|
|
{
|
|
|
return YES;
|
|
return YES;
|