35@interface NSObject (OOCompareByPointerValue)
37- (NSComparisonResult) ooCompareByPointerValue:(
id)other;
46 [membersList setDoubleAction:[membersList action]];
47 [membersList setAction:NULL];
55 NSEnumerator *memberEnum =
nil;
57 NSMutableArray *members =
nil;
62 members = [NSMutableArray array];
63 for (memberEnum = [
object objectEnumerator]; (member = [memberEnum nextObject]); )
66 [members addObject:memberRef];
71 [members sortUsingSelector:@selector(ooCompareByPointerValue:)];
72 if (![_members isEqualToArray:members])
75 _members = [members copy];
76 [membersList reloadData];
81- (IBAction) inspectLeader:(
id)sender
83 [[[
self object] leader] inspect];
87- (IBAction) inspectMember:(
id)sender
89 NSInteger clickedRow = [sender clickedRow];
90 if (clickedRow < 0)
return;
92 [[_members objectAtIndex:clickedRow] inspect];
96- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
98 return [_members count];
102- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
104 return [[_members objectAtIndex:row] inspDescription];
110@implementation OOShipGroup (OOInspectorExtensions)
112- (NSString *) inspDescription
114 NSString *name = [
self name];
115 if (name !=
nil) name = [NSString stringWithFormat:@"\"%@\"", name];
116 else name =
@"anonymous";
118 return [NSString stringWithFormat:@"%@, %lu ships", name, [
self count]];
122- (NSString *) inspBasicIdentityLine
124 NSString *name = [
self name];
125 if (name !=
nil)
return [NSString stringWithFormat:@"Group \"%@\"", name];
126 else return @"Anonymous group";
130- (NSArray *) debugInspectorModules
139@implementation NSObject (OOCompareByPointerValue)
141- (NSComparisonResult) ooCompareByPointerValue:(
id)other
143 if ((uintptr_t)
self < (uintptr_t)other)
return NSOrderedAscending;
144 if ((uintptr_t)
self > (uintptr_t)other)
return NSOrderedDescending;
145 return NSOrderedSame;
NSString * InspectorUnknownValueString(void)
NSString * inspDescription()